UIKit or SwiftUI First? Exploring the Best Hybrid Approach

UIKit and SwiftUI each have their own strengths and weaknesses:

  • UIKit: More performant (e.g., UICollectionView).

  • SwiftUI: Easier to create shiny UI and animations.

My usual approach is to base my project on UIKit and use UIHostingController whenever I need to showcase visually rich UI or animations (such as in an onboarding presentation).

So far, this approach has worked well for me—it keeps the project clean while solving performance concerns effectively.

However, I was wondering: Has anyone tried the opposite approach?

Creating a project primarily in SwiftUI, then embedding UIKit when performance is critical.

If so, what has your experience been like? Would you recommend this approach?

I'm considering this for my next project but am unsure how well it would work in practice.

I think it’s a total acceptable approach. Going SwiftUI-first while embedding UIKit components can work quite well for rapid iteration. It’s also great for cases where there isn’t a 1-1 functionality mapping in a UIKit API. representables makes it easy to encapsulate UIKit components into a SwiftUI App.

UIKit or SwiftUI First? Exploring the Best Hybrid Approach
 
 
Q