ViewWrapper

@available(iOS 13.0, *)
public struct ViewWrapper<T> : UIViewRepresentable where T : UIView

通用UIView包装器

  • 指定makeUIView闭包初始化

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

UIViewRepresentable