FW

extension FW
  • 根据名称加载UIImage,优先加载图片文件(无缓存),文件不存在时尝试系统imageNamed方式(有缓存)

    Declaration

    Swift

    public static func image(_ named: String, bundle: Bundle? = nil) -> UIImage?
  • 搜索路径

    Declaration

    Swift

    public static func pathSearch(_ directory: FileManager.SearchPathDirectory) -> String

    Parameters

    directory

    搜索目录

    Return Value

    目标路径

  • 沙盒路径,常量

    Declaration

    Swift

    public static var pathHome: String { get }
  • 文档路径,iTunes会同步备份

    Declaration

    Swift

    public static var pathDocument: String { get }
  • 缓存路径,系统不会删除,iTunes会删除

    Declaration

    Swift

    public static var pathCaches: String { get }
  • Library路径

    Declaration

    Swift

    public static var pathLibrary: String { get }
  • 配置路径,配置文件保存位置

    Declaration

    Swift

    public static var pathPreference: String { get }
  • 临时路径,App退出后可能会删除

    Declaration

    Swift

    public static var pathTmp: String { get }
  • bundle路径,不可写

    Declaration

    Swift

    public static var pathBundle: String { get }
  • 资源路径,不可写

    Declaration

    Swift

    public static var pathResource: String { get }
  • 确保值在固定范围之内

    Declaration

    Swift

    public static func clamp<T>(_ min: T, _ value: T, _ max: T) -> T where T : Comparable

    Parameters

    min

    最小值

    value

    当前值

    max

    最大值

    Return Value

    范围之内的值