Skip to content

Instantly share code, notes, and snippets.

@wagyu298
Created June 19, 2013 01:06
Show Gist options
  • Save wagyu298/5810926 to your computer and use it in GitHub Desktop.
Save wagyu298/5810926 to your computer and use it in GitHub Desktop.
UISwipeGestureRecognizer event handler from iPhone Flat Design UI http://www.appdesignvault.com/iphone-flat-ui-design-patterns/.
- (void)swipedScreen:(UISwipeGestureRecognizer*)gesture {
UIView* view = gesture.view;
CATransition *transition = [CATransition animation];
transition.duration = 0.75;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype =kCATransitionFromLeft;
transition.delegate = self;
[self.view.layer addAnimation:transition forKey:nil];
[view removeFromSuperview];
[view removeGestureRecognizer:self.swipeGesture];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment