2

Is it possible to set certain UIView property (eg. background color) to be used only at design time in interface builder?

Reason is that I have some custom controls, that does not have render themselves in interface builder different than plain UIView so they doesn't stand out from background.

zgorawski
  • 2,597
  • 4
  • 30
  • 43

1 Answers1

1

No, you can do such a thing only with constraints. If you want to set the color for a UIView which will distinguish it from its background you have to overwrite it somewhere. For example, in a UIView subclass, you can do it in an initializer or in awakeFromNib method.

Another option is using IB_DESIGNABLE and setting the color in the initWithFrame initializer which is used by the Xcode for prerendering of your custom views.

Kamil Szostakowski
  • 2,153
  • 13
  • 19