How to correctly dismiss a UINavigationController that's presented as a modal?

后端 未结 8 1805
情话喂你
情话喂你 2021-02-01 16:04

In my TabBarViewController, I create a UINavigationController and present it as a modal.

var navController =  UINavigationController()
let messageVC         


        
8条回答
  •  逝去的感伤
    2021-02-01 16:30

    This is how I solve the problem in Objective C.

    You can call dismissViewControllerAnimated:NO on your self.navigationController itself.

    Objective C

    [self.navigationController dismissViewControllerAnimated:NO completion:nil];
    

    Swift

    self.navigationController.dismissViewControllerAnimated(false, completion: nil)
    

提交回复
热议问题