Radon 是 E-sites iOS Suite 的一部分。
一个轻量级的框架,用于安排和取消本地通知。
灵感来源于 R.swift,作者是 Mathijs Kadijk。👏
R.swift 和 Radon 的区别在于,Radon 只查找图片,并且有一个特殊的--watch
参数。
Podfile
pod 'Radon'
然后
pod install
只需下载 radon 二进制文件,并将其放置在您喜欢的任何位置。
只需运行
$ Pods/Radon/bin/radon
使用以下选项
Usage: Pods/Radon/bin/radon [options]
-f, --folder:
The folder to scan
-o, --output:
The folder to write the Radon.swift files to
-w, --watch:
Automatically watch the 'folder'
-r, --remove_foldernames:
Remove the name of the folder from the filename
使用 --watch
选项,cli 应用程序将自动扫描文件夹,并在该文件夹中进行任何更改时生成 Radon 文件。
例如
$ Pods/Radon/bin/radon --folder ./Resources/ --output ./Classes/Generated/ --watch --remove_foldernames
这将生成两个文件
您可以在您的项目中使用这两个文件。
有关更多信息,请参阅示例项目。
let image = Radon.images.assets.icons.ironMan
let imageView = UIImageView(image: image)
imageView.frame = CGRect(x: 50, y: 50, width: 100, height: 100)
self.view.addSubview(imageView)
为了您的方便,您还可以使用速记的 R.swift 表示法。
typealias R = Radon