Integrating SwiftUI & UI Kit
summary
SwiftUI is promising but incomplete so the concrete claims are: it interoperates with UIKit and there are two practical paths — start SwiftUI and wrap UIKit with UIViewRepresentable/UIViewControllerRepresentable (use make update optional makeCoordinator and heed that environmentObject injection does not work for representables) or embed SwiftUI in UIKit via UIHostingController or hostingController.view. Practical gotchas: missing controls (collection views text views image picker etc) and a real app example where three collection views redraw on every keystroke causing horrible performance, so avoid creating UIKit objects repeatedly.
AI-written summary · about








