Finley Home

IBInspectable / IBDesignable

Links, Objective C, Xcode, Development

Marked with @IBInspectable (or IBInspectable in Objective-C), they are easily editable in Interface Builder's inspector panel. Note that Xcode goes the extra mile here—property names are converted from camel- to title-case and related names are grouped together.


As if that weren't enough, IBDesignable custom views also debut in Xcode 6. When applied to a UIView or NSView subclass, the @IBDesignable designation lets Interface Builder know that it should render the view directly in the canvas. This allows seeing how your custom views will appear without building and running your app after each change.

IBInspectable / IBDesignable

These new methods are downright game changing, in my opinion, for Interface Builder. I have, like many developers, had a hot/cold relationship with Interface Builder. One of my biggest grumbles is custom views. Some projects don’t have a lot of custom views, so I’m down with IB. Others have a ton, so I’m not. Now with a limited amount of work, I can make my custom view configurable in Interface Builder. Might have to give this a try in my next app.