Advertisement
Guest User

Pass through hit-test

a guest
Jul 14th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.31 KB | None | 0 0
  1. public class CustomView: UIView {
  2.    
  3.     override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
  4.         if let hitView = super.hitTest(point, with: event), !hitView.isKind(of: UIButton.self) {
  5.             return hitView
  6.         } else {
  7.             return nil
  8.         }
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement