Ich arbeite mit uiswipegesture recognizer direction nach oben und unten. Es funktioniert ordnungsgemäß, aber wenn ich hinzufügen, UINavigationController Swipe funktioniert nicht. Dies ist mein Code ...uiswipegesture_recognizerdirectionup und uinavigationcontroller funktionieren nicht?
//In viewDidLoad
UISwipeGestureRecognizer *gesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipe:)];
gesture.direction = UISwipeGestureRecognizerDirectionUp | UISwipeGestureRecognizerDirectionDown;
[self.view addGestureRecognizer:gesture];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapViewController:)];
[self.view addGestureRecognizer:tap];
-(void)didSwipe:(UIGestureRecognizer *)gestureRecognizer {
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setDuration:1.25];
[animation setDelegate:self];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
CALayer *layer = [self.view layer];
[layer addAnimation:animation forKey:nil];
[self.view.window addSubview:self.view];
}
- (void) onTapViewController: (UIGestureRecognizer *) gesture {
}
- (IBAction)onClickBtn:(id)sender {
GotoNextViewController *gnvc = [self.storyboard instantiateViewControllerWithIdentifier:@"GNVC"];
[self.navigationController pushViewController:gnvc animated:NO];
}
hier, wenn i-Taste Navigation richtig funktioniert klicken, aber klauen nicht funktioniert.
, was Sie tun müssen, weil Ihr Code Swipe mit mir arbeitet –
, wenn ich die Navigation zu root-View-Controller hinzufügen, es ist für mich nicht – iOS
Arbeits Sind Sie meine Swipe on Navigation oder seine Ansicht Controller –