SwiftCollection 0.5.0

SwiftCollection 0.5.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2019年3月
SPM支持 SPM

Brad HiltonBrad Hilton 维护。



 
依赖项
AssociatedValues~> 5.0.0
OrderedObjectSet~> 5.0.0
 

  • 作者
  • Brad Hilton

AssociatedValues

AssociatedValues 允许您轻松地在类扩展中添加存储属性

extension UIView {
  var identifier: String {
      get {
          return getAssociatedValueForProperty("identifier", ofObject: self, withInitialValue: "Unknown")
      }
      set {
          setAssociatedValue(newValue, forProperty: "identifier", ofObject: self)
      }
  }
}

祝您玩得开心!

安装

AssociatedValues 通过 CocoaPods 提供。安装时,只需在您的 podfile 中包含以下行

use_frameworks!
pod 'AssociatedValues'

确保在您的 .swift 文件顶部导入模块

import AssociatedValues

或者,克隆此存储库或将其作为 zip 文件下载,并将类包含到您的项目中。

作者

Brad Hilton,[email protected]

许可证

AssociatedValues 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。