Search code examples
objective-cxcode4

Custom control with properties in Interface Builder


I want to subclass UILabel and add some properties. Is it possible to make a custom control in Interface Builder and set this properties in it? Like text, font etc.


Solution

  • In previous versions, you could create a custom Interface Builder plugin (IBPlugin). This is not possible in Xcode 4 as IBPlugin support has been removed.

    Update: Support is there (as of 4.1 and 4.2) for editing nibs/xibs containing custom objects provided by IBPlugins, but that's all. That is, custom objects appear as generic views/objects and you don't get the IB palette to edit them. This is incremental progress. In 4.0, you couldn't even open such nibs/xibs. File enhancement requests at bugreport.apple.com if you feel they should bring back full IBPlugin support.