I'm using UIAppearance
a lot for my navigation controllers and other UI objects, and I was wondering if it's possible to have my related objects styled in Interface Builder (maybe with some magic voodoo of @IBDesignable
?)
matt's comments on the question are correct. You're able to successfully use UIAppearance proxies in the prepareForInterfaceBuilder
method.
Example:
@IBDesignable
class MyCustomView: UIView {
override func prepareForInterfaceBuilder() {
MyCustomView.appearance().backgroundColor = UIColor.redColor()
}
}
This will result in all MyCustomView
instances to be rendered red in IB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With