Created
November 23, 2014 12:57
-
-
Save ksm/da1dd59f38babe929c44 to your computer and use it in GitHub Desktop.
Allow a view to capture touches while it is animating (e.g. for interactive animations and transitions)
This file contains hidden or 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
// Presentation Layer Hit Test | |
// Source: WWDC2014 Session 236 | |
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event | |
{ | |
CGPoint pointInSuperview = [self convertPoint:point toView:self.superview]; | |
CGPoint presentationLayerPoint = [self.layer.presentationLayer convertPoint:pointInSuperview fromLayer:self.superview.layer]; | |
return [super hitTest:presentationLayerPoint withEvent:event]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment