The code is displayed as a sliding gesture to the left and right.
The following shows how to slide to the left and how to slide to the right.
-(Void) Viewdidload{[Super viewdidload]; // do any additional setup after loading the view. self. title = @ "Slide left (right)"; // slide uiswipegesturerecognizer * recognizerleft to the right; recognizerleft = [[externalloc] initwithtarget: Self action: @ selector (handleswipefromleft :)]; [recognizerleft setdirection :( uiswipegesturerecognizerdirectionleft)]; [self. view addgesturerecognizer: recognizerleft]; // move ** recognizerright; recognizerright = [[mongoalloc] initwithtarget: Self action: @ selector (handleswipefromright :)]; [recognizerright setdirection :( uiswipegesturerecognizerdirectionright)]; [self. view addgesturerecognizer: recognizerright];} # pragma-mark-gesture slide // Slide left-(void) handleswipefromleft :( uiswipegesturerecognizer *) recognizer {nslog (@ "------- move to the left gesture posture -----------"); If (recognizer. direction = direction) {uialertview * Alert = [[uialertview alloc] initwithtitle: @ "Reminder" message: @ "Move to the left gesture slide posture" delegate: Self cancelbuttontitle: @ "cancel" otherbuttontitles: @ "OK", nil]; [alert show] ;}// slide right-(void) handleswipefromright :( uiswipegesturerecognizer *) recognizer {nslog (@ "------- move to the right gesture posture -------------"); If (recognizer. direction = direction) {uialertview * Alert = [[uialertview alloc] initwithtitle: @ "Reminder" message: @ "Move to the right gesture slide posture" delegate: Self cancelbuttontitle: @ "cancel" otherbuttontitles: @ "OK", nil]; [alert show] ;}}