> On Jun 17, 2017, at 3:11 PM, Jonathan Mitchell <[email protected]> wrote:
> 
>> On 17 Jun 2017, at 16:36, Charles Srstka <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>>> On Jun 17, 2017, at 8:36 AM, Jonathan Mitchell <[email protected] 
>>> <mailto:[email protected]>> wrote:
>> 
>> 
>> Just tested it on 10.9; it works :-)
>> 
>> import Foundation
>> 
>> class C: NSObject {
>>    @objc dynamic var foo = "Foo"
>> }
>> 
>> let c = C()
>> 
>> let observer = c.observe(\.foo) { obj, _ in
>>    print("Foo changed: now it's \(obj.foo)")
>> }
>> 
>> c.foo = "Bar"
>> 
>> Running it on my Mavs VirtualBox VM, this outputs:
>> 
>> $ ./kvotest
>> Foo changed: now it's Bar
>> 
>> Charles
> 
> Thanks for taking the time to test that.
> I haven’t had time this week to take look at the new 10.13 APIs.
> 
> Will the above translate to Obj-C?

It’s in the Swift overlay, so no Obj-C, sorry.

Charles

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to