Dismiss two modal view controllers

后端 未结 2 1366
野趣味
野趣味 2020-12-19 02:01

I have a navigation controller which present one modal viewController. From inside this modal viewController I present another modal viewController. All I want is to get bac

相关标签:
2条回答
  • 2020-12-19 02:30

    In iOS 5 you need to do

    [self.presentingViewController.presentingViewController dismissModalViewControllerAnimated:YES]

    Edit: As of iOS 6 dismissModalViewControllerAnimated: is deprecated.

    You need to call

    [self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ // Do something on completion}]

    0 讨论(0)
  • 2020-12-19 02:33

    Problem solved :)

    I tried

    [self.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];    
    

    and works.

    Thanks.

    0 讨论(0)
提交回复
热议问题