ポートレートモードとランドスケープモードで「スワイプジェスチャを上下にスワイプ」するアクションを作成したいのですが、初心者なのでできません。助けてください。
これが私のコードです:
-(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");
}
}
}