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
Post a Comment