ios - Using IBDesignable and IBInspectable with UIViewController -


i new ios development. using swift , want design views programmatically use ibdesigner , ibinspectable speed design process.

right have view controller various buttons , labels on it. here snippet of code:

@ibdesignable class landingview: uiviewcontroller, landingviewprotocol {      @ibinspectable lazy var backbutton: uibutton = {         var button = uibutton()         button.backgroundcolor = styles.button_color         return button     }()     @ibinspectable lazy var caption: uilabel = uilabel() } 

my question how use interface builder ibdesignable , ibinspectable? need add .xib? saw other questions mentioning need use playground, trying avoid using that, wanted know if possible view entire viewcontroller?

thank you,

you can not use ibdesignable class not inherit uiview or nsview. check guideline apple ibdesignable:

you can use 2 different attributes—@ibdesignable , @ibinspectable—to enable live, interactive custom view design in interface builder. when create custom view inherits uiview class or nsview class, can add @ibdesignable attribute before class declaration

source: live rendering

a


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -