views:

169

answers:

1

Hi,

I've created a UIView (of type ColumnView) in Interface Builder.
Is it possible to add that UIView multiple times to my window?

I'm trying to create a UIView template that I can add to my window in a couple of places but can't figure out how to do that.

I tried referencing the outlet of that UIView to 2 different IBOutlets but when I add the 2 outlets to my window, it's just treated as a single UIView.
Need the UIView to be duplicated.

Thanks,
Tee

A: 

A simple way is to duplicate the view in the Inteface Builder so there are two instances. Wire them to the outlets and you are done.

Laurent Etiemble
Thanks Laurent, but duplicating the view instances in Interface Builder is exactly what I'm trying to avoid. I want to be able to change 1 view and change all views (i.e a universal view asset if you will). Thanks, Tee
teepusink
Then there are two options left:- Isolate your view into a NIB and bind it to a ViewController. This way, you will keep the ability to design it with IB. This add a controller overhead.- Subclass UIView and do the view layout programmatically. The view is usable directly, but it is hard to design complex layout.
Laurent Etiemble