Skip to content

Instantly share code, notes, and snippets.

@pigfly
Created March 30, 2016 06:46
Show Gist options
  • Save pigfly/cc9d7ca4c69aec870d1d0f3c8c40dd4d to your computer and use it in GitHub Desktop.
Save pigfly/cc9d7ca4c69aec870d1d0f3c8c40dd4d to your computer and use it in GitHub Desktop.
class CustomButton: UIButton {
override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? {
let newPoint = self.layer.presentationLayer()!.convertPoint(point, fromLayer: layer)
return super.hitTest(newPoint, withEvent: event)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment