Reputation: 1
I have a regular custom UIViewController
that loads a regular iPhone-screen-sized XIB. But I have a subview
in the XIB that consists of a few components (UILabel
, UITextField
, UIButton
) that I'd like to factor into a separate XIB, and move the logic controlling these components out of the UIViewController
, possibly to a custom UIView
object that would load the custom XIB.
I've searched Apple documentation without much luck, and searched for an answer here, but I can't seem to find a clean way of creating a custom UIView
, instantiating it in a XIB, and dropping it into another XIB. Is there a clean way of moving this view into it's own XIB and the logic controlling it out of the custom UIViewController
, so I can use it on multiple screens of my app?
(I'm not married to the idea of putting this functionality into a custom UIView
, it just seemed like the obvious way of doing it to me. I'm open to any clean way of factoring this into it's own component.)
Upvotes: 0
Views: 290
Reputation: 26400
If you want to know about multiple views in xib u can go through this
Multiple Views within one XIB - iPhone SDK
This may help you.
If you want to create a view in xib without view controller go through this
Using a xib file without initializing a view controller
I think this should be useful
Upvotes: 1