p-x9 / AssociatedObject

🔗 Swift Macro for allowing variable declarations even in class extensions
MIT License
126 stars 3 forks source link

default value should set to AssociatedObject #22

Closed mlch911 closed 7 months ago

mlch911 commented 7 months ago

Default value should set to AssociatedObject. For example, you have a associated UIView. You don't want to recreate a new view every time you access this value.

@AssociatedObject(.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
var someView: UIView = {
    SomeCustomView()
}()
mlch911 commented 7 months ago

@p-x9 Have got any more free time to review this MR?🤣 I have two more MR waiting.

p-x9 commented 7 months ago

This was a critical problem... Thank you for fixing it.

mlch911 commented 7 months ago

Oh, you are right. I have encounter this error already🤣 Forget to add this commit.

p-x9 commented 7 months ago

Thanks for fixing it. (I know it's hard to update test cases. I think we need to do something about it...)