Can i use navigationStack in a UIKit app that uses some SwiftUI?

Asked on 08/02/2024

1 search

Yes, you can use NavigationStack in a UIKit app that incorporates some SwiftUI. SwiftUI provides seamless interoperability with UIKit, allowing you to embed SwiftUI views within a UIKit view hierarchy using classes such as UIHostingController. This means you can create a NavigationStack in SwiftUI and embed it within your existing UIKit app.

For more details on how to integrate SwiftUI into a UIKit app, you can refer to the SwiftUI essentials session, specifically the chapter on "SDK interoperability" which starts at 20:30. This session covers how to use SwiftUI views within UIKit and vice versa.