测试已测试 | ✓ |
Lang语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年6月 |
SwiftSwift 版本 | 3.1 |
SPM支持 SPM | ✗ |
由 Matt Wakefield 和 John Bailey 维护。
一系列有用的 Swift 扩展和工具。
一系列有用的扩展。
许多额外的 Date
功能。
您是否希望能够更容易地从 URL
对象创建 UIImage
?现在您做到了!
UIImage.load("http://cdn.devmode.com/assets/ben_bio-818b58fc249a9d19ba5a5ce436dd54e1.jpg") { img in
...
}
另外,您的 UIImage
在首次使用后将在本地进行缓存。
轻松地将 URL
查询字符串解析成键值对的 Dictionary
。
let url = URL(string: "http://www.devmode.com?param1=value1¶m2=value2¶m3=value3")
url?.parsedQuery["param1"] // "value1"
url?.parsedQuery["param2"] // "value2"
url?.parsedQuery["param3"] // "value3"
一系列有用的工具。
异步任务的 Operation
子类。
loadingQueue = OperationQueue()
loadingQueue.maxConcurrentOperationCount = 2
loadingQueue.addOperation(AsynchronousOperation { done in
...
})
通过索引轻松检索和存储持久化的设备特定默认值。
Defaults.standard["KEY"] = "VALUE"
Defaults.standard["KEY"] as? String // "VALUE"
您是否希望能在 Swift 中使用传统的日志记录机制?现在可以了!
Logger.log("Test", .warning, "Hello World!")
Logger.warning("Test", "Hello World!")
您是否希望能够更轻松地与属性文件中的嵌套值进行交互?现在可以这样做了!
// Set a persistent environment to switch between property lists.
PropertyList.environment = .production
// Specify the `Bundle` to use to locate the property list.
PropertyList.bundle = Bundle(for: type(of: self))
// Use subscripts and dot-syntax to retrieve values from property list files.
PropertyList.main["Group.SubOne.Key"].string // <nested-value-from-property-list>