xcode - NSView with a KVC property in Swift -


i have custom nsview class defined as:

class myview: nsview {     var sometext: nsstring      override func didchangevalueforkey(key: string)     {         println( key )          super.didchangevalueforkey( key )     }      // other stuff } 

what want able outside of class change value of sometext , have didchangevalueforkey notice sometext has changed can, example, set needsdisplay true view , other work.

how this?

are sure need kvc this? kvc works fine in swift, there’s easier way:

var sometext: nsstring {     didset {         // work every time sometext set     } } 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -