UIImageView
@_spi(FW) extension UIImageView
-
加载网络图片,支持占位、选项、回调和进度,优先加载插件,默认使用框架网络库
Declaration
Swift
public func fw_setImage(url: URLParameter?, placeholderImage: UIImage? = nil, options: WebImageOptions = [], context: [ImageCoderOptions : Any]? = nil, completion: ((UIImage?, Error?) -> Void)? = nil, progress: ((Double) -> Void)? = nil)
-
加载指定URL的本地缓存图片
Declaration
Swift
public static func fw_loadImageCache(url: URLParameter?) -> UIImage?
-
清除所有本地图片缓存
Declaration
Swift
public static func fw_clearImageCaches(completion: (() -> Void)? = nil)
-
创建动画ImageView视图,优先加载插件,默认UIImageView
Declaration
Swift
public static func fw_animatedImageView() -> UIImageView
-
设置主题图片,自动跟随系统改变,清空时需置为nil,二选一
Declaration
Swift
public var fw_themeImage: UIImage? { get set }
-
设置主题图片资源,自动跟随系统改变,清空时需置为nil,二选一
Declaration
Swift
public var fw_themeAsset: UIImageAsset? { get set }
-
Declaration
Swift
open override func themeChanged(_ style: ThemeStyle)
-
设置图片模式为ScaleAspectFill,自动拉伸不变形,超过区域隐藏
Declaration
Swift
public func fw_setContentModeAspectFill()
-
优化图片人脸显示,参考:https://github.com/croath/UIImageView-BetterFace
Declaration
Swift
public func fw_faceAware()
-
倒影效果
Declaration
Swift
public func fw_reflect()
-
图片水印
Declaration
Swift
public func fw_setImage(_ image: UIImage, watermarkImage: UIImage, in rect: CGRect)
-
文字水印,指定区域
Declaration
Swift
public func fw_setImage(_ image: UIImage, watermarkString: NSAttributedString, in rect: CGRect)
-
文字水印,指定坐标
Declaration
Swift
public func fw_setImage(_ image: UIImage, watermarkString: NSAttributedString, at point: CGPoint)