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

renaming files in a directory using python or R -

html - outline-style different in chrome compared to firefox and internet explorer -

Images won't display through CSS -