ViewWrapper

@MainActor
public struct ViewWrapper<T> : UIViewRepresentable where T : UIView

通用UIView包装器

  • 指定makeUIView闭包初始化

    Declaration

    Swift

    @MainActor
    public init(_ maker: (@MainActor @Sendable () -> T)? = nil)
  • 指定updateUIView闭包初始化

    Declaration

    Swift

    @MainActor
    public init(updater: @escaping @MainActor @Sendable (T) -> Void)
  • 指定makeUIView闭包和updateUIView闭包初始化

    Declaration

    Swift

    @MainActor
    public init(_ maker: @escaping @MainActor @Sendable () -> T, updater: @escaping @MainActor @Sendable (T) -> Void)
  • 设置makeUIView闭包

    Declaration

    Swift

    @MainActor
    public func maker(_ maker: @escaping @MainActor @Sendable () -> T) -> ViewWrapper<T>
  • 设置updateUIView闭包

    Declaration

    Swift

    @MainActor
    public func updater(_ updater: @escaping @MainActor @Sendable (T) -> Void) -> ViewWrapper<T>

UIViewRepresentable