skip to content

UIKit

UIKit is the imperative framework most shipping iOS code still uses: view controllers, Auto Layout, table and collection views, the responder chain. Interviews require it even at SwiftUI-first shops.

on this pageshow

explore

questions

page 2 of 2

In a UIKit listings collection view using a diffable data source, every live price update makes rows fade out and back in; why, and how should the updates be applied?

level: seniorimportance: should knowfreq 55%

basics

~20 s

Rows are replaced, not updated: the whole listing, price included, is the item identifier, so a new price is a new item, or the code calls reloadItems(:). Key items by stable ID and call reconfigureItems(:) (iOS 15) to update cells in place.

open as a page

In UIKit, a call screen embeds participant tiles as child view controllers, but each tile's didMove(toParent:) setup never runs and removed tiles stay in memory; what is wrong?

level: seniorimportance: should knowfreq 45%

basics

~20 s

addChild(_:) calls the child's willMove(toParent:) but not didMove(toParent:), which the container must call after adding the child's view. Removing only the view leaves the child in children, still alive; removal needs willMove(toParent: nil), removing the view, then removeFromParent().

open as a page

A UIKit call screen adds participant tiles in viewDidLayoutSubviews() and starts a repeating hide-controls timer in viewWillAppear(_:); why do tiles duplicate and controls hide erratically?

level: seniorimportance: should knowfreq 60%

basics

~20 s

viewDidLayoutSubviews() runs on every layout pass, not once, so tiles are added again on each rotation or inset change. viewWillAppear(_:) runs on every appearance, so each return schedules another timer while the old ones keep firing.

open as a page

As a lead on a UIKit app, would you let view controllers push their own next screen or make coordinators own each flow, and what does the coordinator rule cost?

level: principalimportance: should knowfreq 45%

basics

~20 s

Self-routing screens are simplest for small apps but hard-wire each flow into its view controllers. Coordinators own the UINavigationController and choose the next screen, making flows reusable, but must track Back pops and their own lifetime.

open as a page

When bringing SwiftUI into a large UIKit shopping app, how do you choose between hosting whole screens and bridging components bottom-up, and who owns each boundary?

level: principalimportance: should knowfreq 40%

basics

~20 s

Host whole new screens in UIHostingController when a flow can stay UIKit-navigated, and bridge leaf components with UIHostingConfiguration or representables when screens are shared. Either way, one team owns each boundary type and its contract.

open as a page

As an iOS lead, what list standard do you set for new UIKit screens: collection views with diffable data sources, compositional layout and cell registration, or index-path table views?

level: principalimportance: should knowfreq 35%

basics

~20 s

Default new screens to UICollectionView with compositional layout, CellRegistration and a diffable data source keyed by stable IDs: one model for lists, grids and carousels. Leave working index-path table screens alone and convert one when it is reworked.

open as a page

showing 31–36 of 36