Implement Changes Between Two Views In iPhone

This is the simple application , we will see the how to perform transitions between two views using built-in Core Animation transitions.

Step 1: Create aWindow base application using template. Give the application name “ViewChange”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: In the AppDelegate.h file we have added UIView,UIImageView, and one method (IBAction) for changing the screen. Make the following changes in the AppDelegate.h file.




Step 4: Double click your MainWindow.xib file open it to the Interface Builder. Open the the window and drag view from the library and place it to the window. Next drag Toolbar from the library and place it buttom of the view window. Now select ViewChangeAppDelegate, and bring up connection inspector. Select from ContainerView to the view, and nextTransition to the BarButtonItem. Now save your .xib file and go back to the Xcode.

Step 5: Make the following changes in the AppDelegate.m file.




Step 6: Compile and run the application on the simulator.

You can downloaded SourceCode from here ViewChange

Leave a Comment: