Dismissing both UINavigation views and Modal views at once programmatically

后端 未结 3 1105
梦毁少年i
梦毁少年i 2020-12-01 17:47

I have tried a few answers on this site, but none of them seem to relate to my problem

I have a MasterDetail app which has a two types of segues that I am using. Whe

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 17:48

    You could try replacing [self.dismissViewControllerAnimated:YES completion:nil]; with

    self dismissViewControllerAnimated:YES completion:^{
        [parentViewController.navigationController popToRootViewControllerAnimated:YES];
    }
    

    I believe parentViewController will point to the presenting view controller, and the block will cause the parent view controller's navigation controller to pop to the root view controller.

提交回复
热议问题