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

Generated on 8/2/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.

SwiftUI essentials

SwiftUI essentials

Join us on a tour of SwiftUI, Apple’s declarative user interface framework. Learn essential concepts for building apps in SwiftUI, like views, state variables, and layout. Discover the breadth of APIs for building fully featured experiences and crafting unique custom components. Whether you’re brand new to SwiftUI or an experienced developer, you’ll learn how to take advantage of what SwiftUI has to offer when building great apps.

What’s new in AppKit

What’s new in AppKit

Discover the latest advances in Mac app development. Get an overview of the new features in macOS Sequoia, and how to adopt them in your app. Explore new ways to integrate your existing code with SwiftUI. Learn about the improvements made to numerous AppKit controls, like toolbars, menus, text input, and more.

Enhance your UI animations and transitions

Enhance your UI animations and transitions

Explore how to adopt the zoom transition in navigation and presentations to increase the sense of continuity in your app, and learn how to animate UIKit views with SwiftUI animations to make it easier to build animations that feel continuous.

Platforms State of the Union

Platforms State of the Union

Discover the newest advancements on Apple platforms.

What’s new in UIKit

What’s new in UIKit

Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.

Migrate your TVML app to SwiftUI

Migrate your TVML app to SwiftUI

SwiftUI helps you build great apps on all Apple platforms and is the preferred toolkit for bringing your content into the living room with tvOS 18. Learn how to use SwiftUI to create familiar layouts and controls from TVMLKit, and get tips and best practices.