Last active
December 13, 2015 18:18
-
-
Save TiernanKennedy/4954189 to your computer and use it in GitHub Desktop.
Adding a gesture recognizer
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
// first add a clear button that covers the screen | |
// Now add a gesture recognizer in ViewDidLoad | |
// with target "self" (this class) | |
// and selector (method) "hideCamera" | |
UISwipeGestureRecognizer* upSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(hideCamera)]; | |
// set the direction of the swipe to up | |
[upSwipeRecognizer setDirection:UISwipeGestureRecognizerDirectionUp]; | |
// add the gesture recognizer to your new button | |
[self.myButton addGestureRecognizer:upSwipeRecognizer]; | |
// here is the method we call | |
-(void) hideCamera | |
{ | |
NSLog(@"hide camera"); | |
self.cameraWebView.hidden = TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment