B9AssociatedObject

1.0.0

Objective-C associated value wrapper in Swift.
b9swift/AssociatedObject

What's New

First version.

2021-12-28T13:43:21Z

Hope to never have to update.

B9AssociatedObject

Swift Version Swift Package Manager Build Status gitee 镜像 GitHub Source

Objective-C associated value wrapper in Swift.

Installation

Using Swift Package Manager or import manually.

你也可以使用 gitee 镜像

Usage

You can define extended properties like below. All kinds of Swift types are also supported, not only Objective-C objects.

import B9AssociatedObject

private let fooAssociation = AssociatedObject<String>()
extension SomeObject {
    var foo: String? {
        get { fooAssociation[self] }
        set { fooAssociation[self] = newValue }
    }
}

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Tue Nov 08 2022 14:34:42 GMT-0500 (GMT-05:00)