1 Star 0 Fork 0

B9Swift / AssociatedObject

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

B9AssociatedObject

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

方便地在 Swift 中利用 Objective-C 关联对象。

集成

使用 Swift Package Manager 或手工导入。

You can also use GitHub source.

使用

定义扩展属性可以像下面这样,不仅支持 Objective-C 对象,各种 Swift 类型也支持。

import B9AssociatedObject

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

Repository Comments ( 0 )

Sign in to post a comment

About

方便地在 Swift 中利用 Objective-C 关联对象 expand collapse
Cancel

Releases (1)

All

Contributors

All

Activities

Load More
can not load any more
Swift
1
https://gitee.com/b9swift/AssociatedObject.git
git@gitee.com:b9swift/AssociatedObject.git
b9swift
AssociatedObject
AssociatedObject
main

Search

101014 b92fc32e 1850385 101014 af024cb7 1850385