I want to add a "custom" uiview onto a uiviewcontroller, this custom view i created with xib and its a seperate from the view controller,
does anyone know how to add a uiview with a xib into a uiviewcontroller?
Many thanks in advance
addobjective cuiviewuiviewcontroller
I want to add a "custom" uiview onto a uiviewcontroller, this custom view i created with xib and its a seperate from the view controller,
does anyone know how to add a uiview with a xib into a uiviewcontroller?
Many thanks in advance
Best Answer
You mean an additional view, not the main controller view? In that case you can declare a property for the view and load the NIB by hand:
This assumes that you set the
Controller
as the file owner in the Interface Builder and you link the view to theextraView
outlet. Also note that there might be more elegant solutions, like inserting the extra view into the main NIB for your controller; depends on the situation.