Contents

UIKit integration

Add UIKit views to your SwiftUI app, or use SwiftUI views in your UIKit app.

Overview

Integrate SwiftUI with your app’s existing content using hosting controllers to add SwiftUI views into UIKit interfaces. A hosting controller wraps a set of SwiftUI views in a form that you can then add to your storyboard-based app.

[Image]

You can also add UIKit views and view controllers to your SwiftUI interfaces. A representable object wraps the designated view or view controller, and facilitates communication between the wrapped object and your SwiftUI views.

For design guidance, see the following sections in the Human Interface Guidelines:

Topics

Displaying SwiftUI views in UIKit

Adding UIKit views to SwiftUI view hierarchies

Adding UIKit gesture recognizers into SwiftUI view hierarchies

Sharing configuration information

Hosting an ornament in UIKit

See Also

Framework integration