We have a large application that has 21 view controllers – all in a single xib. We’d like to refactor this into individual xib files – one per view controller. I don’t see any obvious way to do this in Xcode 4. Is this possible or do I have to start from scratch?
(Answering my own question here…)
Ahah! (Eureka)
If I open a second xcode window (File->New->Window) and create an empty .xib file, I can drag objects from the xib in the main xcode window into the empty xib in my new xcode window!
You could copy and paste the views out of the big XIB and into new XIBs, but there’s no automated way of doing that. By that I mean select the root view of each view controller, and paste it into the fresh XIB you’ll create for each view controller.
I’m not really sure how you’ve managed to get 21 view controllers into a single XIB, though. There’s only one “File’s Owner”. I suppose you could have multiple view controllers in there that end up being owned by the single file’s owner, but it’s a very strange way to do things. I suggest you move away ASAP (which I’m sure you’re doing by asking this question!) and life will become a lot simpler.