Re: Translating KVO-ed property to Swift
Re: Translating KVO-ed property to Swift
- Subject: Re: Translating KVO-ed property to Swift
- From: Jean-Daniel <email@hidden>
- Date: Mon, 17 Apr 2017 14:40:35 +0200
> Le 17 avr. 2017 à 10:52, Quincey Morris <email@hidden> a écrit :
>
> On Apr 17, 2017, at 01:43 , Jean-Daniel <email@hidden <mailto:email@hidden>> wrote:
>>
>> var version: String? {
>
> A slight correction: this declaration actually must be:
>
>> dynamic var version: String? {
>
>
> otherwise KVO isn’t guaranteed to work in Swift.
This is a good practice, but I don’t think this is required for computed property, especially if you take care of willChange/didChange manually, as the OP does.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden