One Logo Pool Ball
SwiftUI · IOS API REFERENCE

UIHostingController

class · iOS 13.0+ · SDK 27.1

@MainActor @preconcurrency class UIHostingController<Content> where Content : View

A UIKit view controller that manages a SwiftUI view hierarchy. Create a `UIHostingController` object when you want to integrate SwiftUI views into a UIKit view hierarchy. At creation time, specify the SwiftUI view you want to use as the root view for this view controller; you can change that view later using the ``SwiftUI/UIHostingController/rootView`` property. Use the hosting controller like you would any other view controller, by presenting it or embedding it as a child view controller in your interface.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

UIHostingController.canPerformAction(_:withSender:)

Objective-C selectors cannot cross the bridge.

UIHostingController.target(forAction:withSender:)

Objective-C selectors cannot cross the bridge.

All SwiftUI types →