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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -