views:

28

answers:

1

Coming from the .NET world into ObjC and iPhone development, I'm used to providing design-time support for my UI classes. For example, say that I have a custom button class with a color property. I want to be able to set this color in design time from IB. How can I accomplish this? Is it even possible? Worth the effort?

A: 

This is actually very easy to do. In InterfaceBuilder, select the button and open the Attribute Inspector (hotkey: [command]+1). Select the first tab on the top of the Attribute Inspector window, and look at the section titled "View". The entry labeled "Background" will have a colored rectangle next to it, which will likely be split diagonally, half black and half white. That's an indication that the button's background is currently transparent. Click that rectangle, and the color selection box will appear. Don't forget to change the value of the "alpha" slider in the color selection box, or the button will remain completely transparent.

Here's an image of the attribute inspector, configured like I described.

Endemic
Actually, my question was more about if it is possible to create *new* design-time properties.
Krumelur