Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pkluz
Created April 16, 2012 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkluz/2400661 to your computer and use it in GitHub Desktop.
Save pkluz/2400661 to your computer and use it in GitHub Desktop.
ZUUIRevealController - Entire front view interaction....
@interface FrontViewController()
@property (nonatomic, retain) UIPanGestureRecognizer *panGestureRecognizer;
@end
@implementation
@synthesize panGestureRecognizer = _panGestureRecognizer;
- (void)viewDidLoad
{
[super viewDidLoad];
// Rationale: We create a pan gesture recognizer and we define the targat method that we want to be invocated if a certain event were to occur (i.e. panning).
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self.navigationController.parentViewController action:@selector(revealGesture:)];
// We retain a reference to the recognizer.
self.panGestureRecognizer = panGestureRecognizer;
// Memory cleanup (not needed in ARC)
[panGestureRecognizer release];
// Now we add the recognizer to the entire front view.
[self.view addGestureRecognizer:self.navigationBarPanGestureRecognizer];
// From now on, everytime the gesture recognizer, recognizes a pan gesture on the FrontViewController's view, we'll be triggering the revealGesture: method of the ZUUIRevealController.
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment