Daily iOS
Performance and debugging

Navigation stack optimization

Because of deep links or state restoration you have to push dozens of view controllers onto a UINavigationController in a row. What goes wrong if you just do that?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Pushing in a loop makes the animations overlap and break the UI, every VC on the stack stays in memory until it's popped, and the moment anything touches a view, even offscreen screens get loaded.

Share a question