ViewControllerWrapper
@MainActor
public struct ViewControllerWrapper<T> : UIViewControllerRepresentable where T : UIViewController
通用UIViewController包装器
-
指定makeUIViewController闭包初始化
Declaration
Swift
@MainActor public init(_ maker: (@MainActor @Sendable () -> T)? = nil)
-
指定updateUIViewController闭包初始化
Declaration
Swift
@MainActor public init(updater: @escaping @MainActor @Sendable (T) -> Void)
-
指定makeUIViewController闭包和updateUIViewController闭包初始化
Declaration
Swift
@MainActor public init(_ maker: @escaping @MainActor @Sendable () -> T, updater: @escaping @MainActor @Sendable (T) -> Void)
-
设置makeUIViewController闭包
Declaration
Swift
@MainActor public func maker(_ maker: @escaping @MainActor @Sendable () -> T) -> ViewControllerWrapper<T>
-
设置updateUIViewController闭包
Declaration
Swift
@MainActor public func updater(_ updater: @escaping @MainActor @Sendable (T) -> Void) -> ViewControllerWrapper<T>
-
Declaration
Swift
public typealias UIViewControllerType = T
-
Declaration
Swift
@MainActor public func makeUIViewController(context: Context) -> T
-
Declaration
Swift
@MainActor public func updateUIViewController(_ uiViewController: T, context: Context)