Completion handler for UINavigationController “pushViewController:animated”?

前端 未结 9 1091
礼貌的吻别
礼貌的吻别 2020-11-30 18:08

I\'m about creating an app using a UINavigationController to present the next view controllers. With iOS5 there´s a new method to presenting UIViewControl

9条回答
  •  我在风中等你
    2020-11-30 18:10

    Since iOS 7.0,you can use UIViewControllerTransitionCoordinator to add a push completion block:

    UINavigationController *nav = self.navigationController;
    [nav pushViewController:vc animated:YES];
    
    id coordinator = vc.transitionCoordinator;
    [coordinator animateAlongsideTransition:^(id  _Nonnull context) {
    
    } completion:^(id  _Nonnull context) {
        NSLog(@"push completed");
    }];
    

提交回复
热议问题