Advertisement
Guest User

Pass view hit-test

a guest
Jul 14th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.48 KB | None | 0 0
  1. /// Passes user input to main window if user taps on view of type PassView
  2. /// Any other view added to this UIWindow will be visible and interactable over the main UIWindow
  3. public class OverlayWindow: UIWindow {
  4.    
  5.     override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
  6.         if let hitView = super.hitTest(point, with: event), !hitView.isKind(of: PassView.self) {
  7.             return hitView
  8.         } else {
  9.             return nil
  10.         }
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement