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
- (void)handleLongPress:(UILongPressGestureRecognizer*)sender { | |
if (sender.state == UIGestureRecognizerStateEnded) { | |
NSLog(@"UIGestureRecognizerStateEnded"); | |
//Do Whatever You want on End of Gesture | |
} | |
else if (sender.state == UIGestureRecognizerStateBegan){ | |
NSLog(@"UIGestureRecognizerStateBegan."); | |
//Do Whatever You want on Began of Gesture | |
} | |
} |
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
// Create a UITapGestureRecognizer and add it to the view | |
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; | |
tap.cancelsTouchesInView = NO; | |
[self.view addGestureRecognizer:tap]; | |
// In the handleTap Method add | |
- (void)handleTap:(UITapGestureRecognizer *)tap | |
{ | |
[self.view endEditing:YES]; | |
} |
NewerOlder