Created
August 10, 2015 11:00
-
-
Save heinrisch/39047e160335441c98fe to your computer and use it in GitHub Desktop.
Grow hit area
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 hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? { | |
let errorMargin : CGFloat = 30; | |
let largerFrame = CGRectMake(0 - errorMargin, 0 - errorMargin, frame.size.width + 2*errorMargin, frame.size.height + 2*errorMargin); | |
return largerFrame.contains(point) ? self : nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment