Instead of push segue how to replace view controller (or remove from navigation stack)?

前端 未结 14 882
眼角桃花
眼角桃花 2020-11-28 01:46

I have a small iPhone app, which uses a navigation controller to display 3 views (here fullscreen):

\"Xcode

14条回答
  •  抹茶落季
    2020-11-28 02:45

    How about this :) I now it's old question, but this will work as a charm:

    UIViewController *destinationController = [[UIViewController alloc] init];
    UINavigationController *newNavigation = [[UINavigationController alloc] init];
    [newNavigation setViewControllers:@[destinationController]];
    [[[UIApplication sharedApplication] delegate] window].rootViewController = newNavigation;
    

提交回复
热议问题