Skip to content

Commit

Permalink
visibleRect for UIView
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed May 1, 2024
1 parent b6c3297 commit 7d33750
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/NSUI/Views.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ extension NSUIActivityIndicatorView {
final class NSUIHostingView<Content: View>: UIView {
}

extension UIView {
public var visibleRect: CGRect {
superview?.bounds.intersection(frame) ?? .zero
}
}

#endif

0 comments on commit 7d33750

Please sign in to comment.