Skip to content

Instantly share code, notes, and snippets.

@projectfebr
Created June 30, 2022 08:38
Show Gist options
  • Select an option

  • Save projectfebr/caacaf51a510ff0ea26d12be114bbc8a to your computer and use it in GitHub Desktop.

Select an option

Save projectfebr/caacaf51a510ff0ea26d12be114bbc8a to your computer and use it in GitHub Desktop.
point(inside:) для subview за пределами bounds родительской view
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