UIKit interview questions
View controller lifecycle, Auto Layout, lists and collections, hit-testing and navigation in UIKit.
– interview-ready · 13 questions in this topic
– of 13 tried
Saved on this device. Interview-ready means you got it right on two different days. Guesses and hints count for less.
Questions
- The UIViewController lifecycleOrder the steps
- How Auto Layout worksPick the fix
- Content hugging and compression resistancePredict
- frame vs boundsPredict
- Table and collection view cell reuseSpot the bug
- UICollectionView vs UITableView and diffable data sourcesPick the fix
- UICollectionViewCompositionalLayoutPick the fix
- layoutSubviewsPick the fix
Practise this topic
Flashcards · 20
Flip, then say if you knew it. Needs JavaScript; every answer is also on its question page.
Quick quiz · 13 questions
One exercise per question, checked as you go. Needs JavaScript.
Mock interview · 2 sets
Timed, out loud, then tick what you covered. Needs JavaScript.
Fix this PR · 1 review
Review a diff like a senior: flag the lines you'd comment on. Needs JavaScript.
Quick facts
Recall the answer first, then tap Show to check.
UIStackView
Arranges subviews in a row or column using Auto Layout. It has no background of its own before iOS 14 and adds no extra drawing.
Safe area
safeAreaLayoutGuideandsafeAreaInsetskeep content clear of the notch, Dynamic Island, home indicator and bars.UINavigationController
Manages a stack of view controllers with push and pop, a navigation bar and a back gesture.
UIPageViewController
Pages between view controllers with scroll or page-curl transitions; supply them through a data source.
UISplitViewController
Primary and secondary (plus optional supplementary) columns on iPad and Mac; collapses on iPhone.
NSAttributedString
Text with per-range attributes (font, colour, links). In Swift, AttributedString (iOS 15) is the value-type alternative.
draw(_:)
Override only for custom Core Graphics drawing; it is CPU-bound, so prefer layers or images for static content.
Printable cheat sheet · Review your weak spots in this topic