Unfortunately, it's not possible to make a custom UINavigationItem
rendered in the interface builder (what @IBDesignable
is meant for). In the docs (a Live Rendering section) they say you must inherit a class from UIView
/NSView
. In turn, UINavigationItem
is inherited from NSObject
.
Live Rendering
You can use two different attributes—@IBDesignable and
@IBInspectable—to enable live, interactive custom view design in
Interface Builder. When you create a custom view that inherits from
the UIView class or the NSView class, you can add the @IBDesignable
attribute just before the class declaration. After you add the custom
view to Interface Builder (by setting the custom class of the view in
the inspector pane), Interface Builder renders your view in the
canvas.