Created
April 16, 2012 18:50
-
-
Save pkluz/2400661 to your computer and use it in GitHub Desktop.
ZUUIRevealController - Entire front view interaction....
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
@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