DevPrep

All topics › SwiftUI

What is SwiftUI and how does it differ from UIKit?

Junior PRO

The gist

SwiftUI is Apple's declarative UI framework (since 2019): you describe what the interface should look like for the current state, and the framework computes the difference and updates the screen. UIKit is imperative: you create view objects, add them to the hierarchy and mutate them by hand on every data change.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store