Initializer

init(rootView:)

Creates a hosting controller object that wraps the specified SwiftUI view.

Declaration

init(rootView: Content)

Parameters

rootView

The root view of the SwiftUI view hierarchy that you want to manage using the hosting view controller.

Return Value

An UIHostingController obect initialized with the specified SwiftUI view.

See Also

Creating a Hosting Controller Object

init?(coder: NSCoder, rootView: Content)

Creates a hosting controller object from an archive and the specified SwiftUI view.

init(nibName: String?, bundle: Bundle?)

Creates a hosting controller object from the contents of the specified nib file.

init?(coder: NSCoder)

Creates a hosting controller object from the contents of the specified archive.