Я пытаюсь интерактивно уволить UINavigationController с на UIViewController на своем стекеуволить UINavigationController интерактивными
я. Я представляю следующее:
UIViewController *vc = [UIViewController new];
UINavigationController *nav = [[UINavigationController alloc] initWithRoot:vc];
[self presentViewController:nav animated:YES completion:nil];
ii .. В моем контроллере ViewController я установлен в файле .h. В .m файле я установил self.transitioningDelegate.self
Я также пробовал self.navigationController.transitioningDelegate = self
iii. Наконец, я применяю методы делегатов:
#pragma mark - ViewControllerTransitioning Delegate Methods
- (id<UIViewControllerAnimatedTransitioning>)
animationControllerForPresentedController:(UIViewController *)presented
presentingController:(UIViewController *)presenting
sourceController:(UIViewController *)source {
NSLog(@"\n\nTRANSIT 1\n\n");
// allow the interaction controller to wire-up its gesture recognisers
[_interactionController wireToViewController:presented
forOperation:CEInteractionOperationDismiss];
_animationController.reverse = NO;
return _animationController;
}
- (id<UIViewControllerAnimatedTransitioning>)
animationControllerForDismissedController:(UIViewController *)dismissed {
NSLog(@"\n\nTRANSIT 2\n\n");
_animationController.reverse = YES;
return _animationController;
}
- (id<UIViewControllerInteractiveTransitioning>)
interactionControllerForDismissal:
(id<UIViewControllerAnimatedTransitioning>)animator {
NSLog(@"\n\nTRANSIT 3\n\n");
// provide the interaction controller, if an interactive transition is in progress
return _interactionController.interactionInProgress
? _interactionController : nil;
}
iv. К сожалению, интерактивная часть никогда не выполняется. Когда я вручную нажимаю кнопку, которая вызывает [self dismissViewControllerAnimated:YES completion:nil];
Печатаются как транзит 2, так и транзит 3, но транзит 1 никогда не доходит. Есть ли у кого-нибудь предложения, что это может быть? Благодаря!
Я не уверен, но вы можете попробовать '[self.navigationController popViewControllerAnimated: YES];' вместо '[self rejectViewControllerAnimated: YES complete: nil];'. Я думаю что. –
, к сожалению, не будет работать – trdavidson