Original question Description: Hello everyone, please ask a question about UIGestureRecognizer. For example, I need to use UIAlertView to confirm the submission action after the user completes the operation. I have tried some methods and have not succeeded. Solution: [java] Using * gesture1 = [[using alloc] initWithTarget: self action: @ selector (didSwipeRight :)]; gesture1.direction = direction; [yourView progress: gesture1]; in the Action method: [java]-(void) didSwipeLeft :( UIGestureRecognizer *) gestureRecognizer {UIAlertView * Alert = [[UIAlertView alloc] initWithTitle: @ "message: @ "Are you sure to commit with its action" delegate: self cancelButtonTitle: CKString (@ "NO") otherButtonTitles: CKString (@ "YES"), nil]; [Alert show]; Alert. tag= 222; Alert. delegate = self; [Alert release];} In AlertView Delegate [java]-(void) alertView :( UIAlertView *) alertView clickedButtonAtIndex :( NSInteger) buttonIndex {if (alertView. tag = 222) {if (buttonIndex = 1) {// Yes condition} else {///No condition }}}