ImageView

@available(iOS 13.0, *)
public struct ImageView : UIViewRepresentable

图片视图,支持网络图片和动图

  • 指定本地占位图片初始化

    Declaration

    Swift

    public init(_ placeholder: UIImage? = nil)
  • 指定网络图片URL初始化

    Declaration

    Swift

    public init(url: Any?)
  • 设置网络图片URL

    Declaration

    Swift

    public func url(_ url: Any?) -> ImageView
  • 设置网络图片加载选项

    Declaration

    Swift

    public func options(_ options: WebImageOptions) -> ImageView
  • 设置本地占位图片

    Declaration

    Swift

    public func placeholder(_ placeholder: UIImage?) -> ImageView
  • 设置图片显示内容模式,默认scaleAspectFill

    Declaration

    Swift

    public func contentMode(_ contentMode: UIView.ContentMode) -> ImageView

UIViewRepresentable