UIHostingControllerFactory
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
@MainActor
public struct UIHostingControllerFactory<ContentView, Context> : Factory where ContentView : View
Builds UIHostingController with ContentView as a UIHostingController.rootView using the provided block.
-
Declaration
Swift
public typealias ViewController = UIHostingController<ContentView> -
Declaration
Swift
public typealias Context = Context
-
Declaration
Swift
@MainActor public func build(with context: Context) throws -> UIHostingController<ContentView>
-
Builds
UIHostingControllerwithContentViewas aUIHostingController.rootViewusing the provided block.Declaration
Parameters
buildBlockBlock that builds the
Viewwith the using theContextinstance provided.