UIHostingControllerWithContextFactory
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
@MainActor
public struct UIHostingControllerWithContextFactory<ContentView> : Factory where ContentView : ContextInstantiatable
Builds UIHostingController
with ContentView
as a UIHostingController.rootView
using the constructor
provided with ContextInstantiatable
implementation.
-
Declaration
Swift
public typealias ViewController = UIHostingController<ContentView>
-
Declaration
Swift
public typealias Context = ContentView.Context
-
Constructor
Declaration
Swift
@MainActor public init()
-
Declaration
Swift
@MainActor public func build(with context: Context) throws -> UIHostingController<ContentView>
-
Builds
UIHostingController
withContentView
as aUIHostingController.rootView
using the constructor provided withContextInstantiatable
implementation.Declaration
Swift
@MainActor static var hostingControllerWithContextFactory: `Self` { get }