Created
November 5, 2014 11:32
-
-
Save yuxiangq/4dfeebc687b459b629bc to your computer and use it in GitHub Desktop.
UILongPressGestureRecognizer实例
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
//在这里我需要给UITableViewCell添加长按手势,非重点代码我将省略 | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
//... | |
UILongPressGestureRecognizer *longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:cell action:@selector(longPressDoSomething:)]; | |
[cell addGestureRecognizer:longPressGestureRecognizer]; | |
//... | |
return cell; | |
} | |
-(void)longPressDoSomething:(UILongPressGestureRecognizer*)sender{ | |
//DoSomething | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment