I have a method that loads a nib file containing a view:
[[NSBundle mainBundle] loadNibNamed:@"NewView" owner:self options:nil];
and I was wondering if it’s possible to add a simple transition when the view loads. I have scoured the internet and I haven’t been able to find anything.
There are many ways to present views and animate them.
You can create create using loadNibnamed:
How to load a UIView using a nib file created with Interface Builder
One way to animate a view in is to present it modally. This will animate from the bottom:
These posts show getting more control how it animates in using modalTransitionStyle
How can I change the animation style of a modal UIViewController?
iPhone – presentModalViewController with transition from right
Another option is to create a view, add it as a subView to your current view and animate the frame. If you’re just loading a view, consider using UINib – it was added in iOS 4.0 and caches. It double perf.
Then, you can add it as a subView.
If you want to animate subViews within your view, see this tutorial:
http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial
Specifically: