UINavigationController's setViewControllers adds back button in IOS10
Asked Answered
B

1

6

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?

Began answered 6/8, 2017 at 21:31 Comment(3)
I have the same problem. But the back button shows only when the parameter animated is set to true.Southard
Any solution/workaround? The only thing I see is to add empty left bar button, but looks a bit dirty.Began
got the same problem, ended up in animated: falseEverett
M
0

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"
Maloney answered 12/5, 2020 at 23:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.