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 pageshowhide
explore
- View Controller Lifecycle6 questions
- Auto Layout & Constraints6 questions
- Table & Collection Views6 questions
- Responder Chain & Events6 questions
- Navigation & Presentation6 questions
- SwiftUI Bridging6 questions
questions
page 2 of 2In 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?
basics
~20 sRows 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.
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?
basics
~20 saddChild(_:) 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().
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?
basics
~20 sviewDidLayoutSubviews() 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.
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?
basics
~20 sHost 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.
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?
basics
~20 sDefault 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.
showing 31–36 of 36