-(Void) viewdidload {
Uiswipegesturerecognizer * recognizer;
Recognizer = [uiswipegesturerecognizer
Alloc] initwithtarget: Self
Action: @ selector (handleswipefrom :)];
[Recognizer setdirection uiswipegesturerecognizerdirectionright)];
[[Self
View] addgesturerecognizer: recognizer];
[Recognizer
Release];
Recognizer = [uiswipegesturerecognizer
Alloc] initwithtarget: Self
Action: @ selector (handleswipefrom :)];
[Recognizer setdirection uiswipegesturerecognizerdireleft left)];
[[Self
View] addgesturerecognizer: recognizer];
[Recognizer
Release];
Recognizer = [uiswipegesturerecognizer
Alloc] initwithtarget: Self
Action: @ selector (handleswipefrom :)];
[Recognizer setdirection uiswipegesturerecognizerdirectionup)];
[[Self
View] addgesturerecognizer: recognizer];
[Recognizer
Release];
Uiswipegesturerecognizer * recognizer;
Recognizer = [uiswipegesturerecognizer
Alloc] initwithtarget: Self
Action: @ selector (handleswipefrom :)];
[Recognizer setdirection uiswipegesturerecognizerdirectiondown)];
[[Self
View] addgesturerecognizer: recognizer];
[Recognizer
Release];
}
-(Void) handleswipefrom :( uiswipegesturerecognizer *) recognizer {
If (recognizer. Direction = uiswipegesturerecognizerdirectiondown)
{
Nslog (@ "swipe down ");
// Execute the program
}
If (recognizer. Direction = uiswipegesturerecognizerdirectionup)
{
Nslog (@ "swipe up ");
// Execute the program
}
If (recognizer. Direction = uiswipegesturerecognizerdirectionleft)
{
Nslog (@ "Swipe left ");
// Execute the program
}
If (recognizer. Direction = uiswipegesturerecognizerdirectionright)
{
Nslog (@ "Swipe right ");
// Execute the program
}
}