I would like to create an action "swipe gesture up & down" differente in portrait and landscape mode, but i'm newbies I can't do this, can you please help me?
Here is my code :
-(void)swipeToggle:(id)sender {
if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeLeft || [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeRight) {
if (UISwipeGestureRecognizerDirectionUp){
NSLog(@"if gesture up - LS");
} else if (UISwipeGestureRecognizerDirectionDown) {
NSLog(@"else if gesture down - LS");
}
}
else if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait) {
if (UISwipeGestureRecognizerDirectionDown) {
NSLog(@"if gesture down - PT");
}
else if (UISwipeGestureRecognizerDirectionUp) {
NSLog(@"else if gesture up - PT");
}
}
}