I have managed to get the IBDesignable/IBInspectable
attributes working with direct subclasses of NSView
but not with a direct subclass of NSButton
. This is causing me to question if in fact the Cocoa implementation is somehow limited to NSView
only.
Almost every example on the web (and Apple WWDC 2014 Xcode video) use NSView
and then drag a custom view component from the library onto the canvas (and then change its class).
Is it possible to use IBDesignable
with subclasses of NSControl
and NSButton
etc...? I have seen many examples on the web using UIButton
.
If it is possible, then what are you supposed to drag from the library onto the canvas? It doesn't make sense for it to be a "custom view". On the other hand, there is no "custom control" available.
To be clear, I can get the IBInspectable attribute to show up at design time; but any changes don't seem to live render at design time.
The workaround is to wrap any custom NSButton
I want to create within an NSView
(via composition) but this seems like a bit of a hack...