Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom controls in Interface Builder (Xcode)

So I've created a custom control inherited from UIView and I want to use it in Interface Builder. I know I can add an UIView and set its class name to my custom control class name but it only appears on runtime; in interface builder it's just a regular UIView. I want to see the control while I am working on the UI in interface builder.

Thanks

like image 804
Peyman Avatar asked Mar 20 '23 10:03

Peyman


1 Answers

Xcode 6 has added a form of support for placing and previewing custom controls. See the official Apple docs on "Creating a Custom View That Renders in Interface Builder": https://developer.apple.com/library/ios/recipes/xcode_help-IB_objects_media/chapters/CreatingaLiveViewofaCustomObject.html

like image 197
Scott Ferwerda Avatar answered Mar 23 '23 01:03

Scott Ferwerda