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
UIHostingController
withContentView
as aUIHostingController.rootView
using the provided block.Declaration
Parameters
buildBlock
Block that builds the
View
with the using theContext
instance provided.