I’m working on an animation effect where a view (containing subviews like buttons, labels etc.) appears on screen as a very small view with all the subviews spaced closely together, and the view is animated to full-screen and all the subviews change to their final positions.
I’m doing all of this programmatically, but I’d like to be able to use a XIB to lay out the final positions of everything. If I use the XIB for the final layout, however, when the view first loads it will show the subviews in their final positions.
Is there any way I can use 2 separate XIBs for this, one for the initial layout and one for the final layout? Is there any way to take a view that has already been created, and use a XIB to just get the layout positions of the already-existing subviews?
No. Nib files are stored as archived object graphs, so the only way to get any information out of them is to unarchive them, which instantiates a new version of all the objects in the nib.
I guess if you really wanted, you could do that, and then use the frames of the views in the nib to set the frames of the views in your original view.