UINavigationController's setViewControllers adds back button in IOS10

Viewed 568

Noticed strange thing: when you replace view controllers stack in UINavigationController using setViewControllers:animated: back button is displayed during animation and disappears when animation completes. Found only in iOS10 (both device and simulator), iOS8 and 9 work correctly (no back button). Has anybody faced this issue?

1 Answers

Same Problem here but even with animated:false. I also realized that the memory goes up when I keep repeating. Do they stay in background?

My code:

firstNavigationViewController.setViewControllers([firstRootViewController, secondViewController], animated: false)//
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController = firstNavigationViewController

My workaround is to set the following in viewWillAppear:

navigationController?.navigationBar.backItem?.title = "Protokoll"
Related