Latest 4.1.0
Homepage https://github.com/DominicMDev/AssociatedValues
License MIT
Platforms ios 8.0, tvos 9.0, requires ARC
Authors ,

AssociatedValues

AssociatedValues allows you to easily add stored properties in class extensions:

extension UIView {
  var identifier: String {
      get {
          return getAssociatedValue(key: "identifier", object: self, initialValue: "Unknown")
      }
      set {
          set(associatedValue: newValue, key: "identifier", object: self)
      }
  }
}

Enjoy!

Installation

AssociatedValues is available through CocoaPods. To install, simply include the following lines in your podfile:

use_frameworks!
pod 'AssociatedValues-DominicMDev'

Be sure to import the module at the top of your .swift files:

import AssociatedValues

Alternatively, clone this repo or download it as a zip and include the classes in your project.

Author

Brad Hilton, [email protected]

License

AssociatedValues is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "AssociatedValues-DominicMDev",
    "module_name": "AssociatedValues",
    "version": "4.1.0",
    "swift_version": "4.2",
    "summary": "Associated Objects For Swift Values",
    "description": "AssociatedValues is a simple Swift wrapper around Objective-C runtime associated objects.",
    "homepage": "https://github.com/DominicMDev/AssociatedValues",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Brad Hilton": "[email protected]",
        "Dominic Miller": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DominicMDev/AssociatedValues.git",
        "tag": "4.1.0"
    },
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0"
    },
    "source_files": "AssociatedValues/**/*.{swift,h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This