Push vs Modal Presentation in UIKit
understanding of UIKit navigation models.
push adds to a nav stack with back, modal presents a self-contained interrupting flow.
treating them as interchangeable or ignoring the stack relationship.
WHAT THIS TESTS This checks whether you understand the mental model behind UIKit navigation and can choose the right presentation style for a given UX, which signals real app-building experience.
A GOOD ANSWER COVERS Pushing relies on a UINavigationController managing a stack. pushViewController places a new controller on top, the navigation bar shows a back button, and the transition slides horizontally, communicating that the user is drilling deeper into related, hierarchical content. Presenting modally with present(_:animated:) shows a controller that is not part of any navigation stack; by default it slides up and covers the screen. It signals an interruption, a focused task the user must finish or dismiss before returning. Modals own their own lifecycle and are dismissed with dismiss(animated:).
COMMON WRONG ANSWERS Claiming you can push without a navigation controller. Saying both are equivalent. Forgetting that modal presentation styles changed in iOS 13, where the default became a card that can be swiped down, which affects whether viewWillAppear fires on the presenter.
LIKELY FOLLOW-UPS How do you pass data and get a result back from each? How does the iOS 13 sheet presentation affect lifecycle callbacks? What is modalPresentationStyle and when would you use fullScreen versus pageSheet? How do navigation and modal map onto SwiftUI's NavigationStack and sheet?
ONE CONCRETE EXAMPLE In a messaging app, tapping a conversation pushes the chat detail onto the navigation stack, so the user can tap back to return to the list, reinforcing the hierarchy. Tapping a compose button presents a new-message controller modally, because composing is a self-contained task the user either sends or cancels, after which they land back exactly where they were.
Interview question
A designer wants tapping a list row to feel like drilling into related detail with a back button. Which presentation fits, and what does it require?
- a.Modal presentation, which automatically supplies a back button
- b.Pushing onto a UINavigationController stack, which provides the back buttonCorrect
- c.Either one, since they behave identically at runtime
- d.Pushing directly on the view controller without any navigation controller
Why? this is the answer
Hierarchical drill-in with a back button is the navigation stack's purpose and requires a UINavigationController. Modals interrupt the flow and do not provide a back button by default.
Just read this? Test yourself on what you have been reading.
- #ios
- #swift
- #uikit
- #navigation
- #view-controller
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on ios — each one lists the topics its interview covers.
See open roles