Created
February 15, 2019 08:42
-
-
Save simsaens/7c5a0c9b92a65b0961c0283e8eb4faf8 to your computer and use it in GitHub Desktop.
Add these two overrides to class Header
This file contains 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 { | |
guard let menu = menuView else { | |
return super.point(inside: point, with: event) | |
} | |
let menuPoint = convert(point, to: menu) | |
if menu.point(inside: menuPoint, with: event) { | |
return true | |
} | |
return super.point(inside: point, with: event) | |
} | |
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { | |
guard let menu = menuView else { | |
return super.hitTest(point, with: event) | |
} | |
let menuPoint = convert(point, to: menu) | |
if let view = menu.hitTest(menuPoint, with: event) { | |
return view | |
} | |
return super.hitTest(point, with: event) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment