Created
June 30, 2022 08:38
-
-
Save projectfebr/caacaf51a510ff0ea26d12be114bbc8a to your computer and use it in GitHub Desktop.
point(inside:) для subview за пределами bounds родительской view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func point(inside point: CGPoint, | |
| with event: UIEvent?) -> Bool | |
| { | |
| let inside = super.point(inside: point, with: event) | |
| if !inside { | |
| for subview in subviews { | |
| let pointInSubview = subview.convert(point, from: self) | |
| if subview.point(inside: pointInSubview, with: event) { | |
| return true | |
| } | |
| } | |
| } | |
| return inside | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment