PropertyExtensions
允许您轻松地向类扩展中添加存储属性
extension UIView : PropertyExtensions {
var identifier: String {
get {
return getProperty("identifier", initial: "Unknown")
}
set {
setValue(newValue, forProperty: "identifier")
}
}
}
享受吧!
PropertyExtensions
通过 CocoaPods 提供。要安装,只需在 podfile 中包含以下行
use_frameworks!
pod 'PropertyExtensions'
务必在您的 .swift 文件顶部导入模块
import PropertyExtensions
或者,克隆此仓库或将其作为 zip 下载,并将类包含到您的项目中
Brad Hilton,[email protected]
PropertyExtensions
可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。