
You can have views fly across the screen, fade in or fade, out, rotate around, and many more!
It's a cool part from developer side to make his app representable with enhanced graphics and animations .
Read:
iPhone Core Animation - Drawing a Circle
In the process, you will get some basic idea, how to use UIView animations in both the standard way.
So let’s start the tutorial step by step.
Read:
How to create a Coin Fall Animation
Create a project Xcode, go to “File\New\Project…”, choose iOS\Application\Single View Application, and click ‘Next’.
Name the project AnimationTransitionCurlDown and fill in the other fields, select iPhone as the device target and make sure ‘Use Storyboards’, then click Next. Choose a place to save your project and click Create.
Now, you need to set up the user interface, you will start from the outsider element.
From the project navigator, click on MainStoryboard.storyboard to open it in the storyboard editor.
Drag a UIView and four UIButtons.
ou may need to disable "Autolayout" feature for the sake of this UIView tutorial.
Go ahead, select MainStoryboard.storyboard, under File inspector, uncheck “Use Autolayout”.
So click on ViewController.h to open it in the source code editor
Use "QuartzCore.framework" With these animations.
In ViewController.h ,add outlet property for UIView as RectView:
Add IBAction methods for four UIButtons.
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController{
}
@property (weak, nonatomic) IBOutlet UIView *RectView;
- (IBAction)animateRight:(id)sender;
- (IBAction)animateLeft:(id)sender;
- (IBAction)animateDown:(id)sender;
- (IBAction)animateUp:(id)sender;
@end
#import "ViewController.h"
#import <QuartzCore/QuartzCore.h>
@interface ViewController ( )
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
-(void)pageDown:(UIView*)View
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:View cache:YES];
[UIView commitAnimations];
}
-(void)pageUP:(UIView*)View
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:
UIViewAnimationTransitionCurlUp forView:View cache:YES];
[UIView commitAnimations];
}
-(void)FlipFromLeft:(UIView*)View
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:View cache:YES];
[UIView commitAnimations];
}
-(void)FlipFromRight:(UIView*)View
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:View cache:YES];
[UIView commitAnimations];
}
- (IBAction)animateRight:(id)sender {
[self FlipFromRight:_RectView];
}
- (IBAction)animateLeft:(id)sender {
[self FlipFromLeft:_RectView];
}
- (IBAction)animateDown:(id)sender {
[self pageDown:_RectView];
}
- (IBAction)animateUp:(id)sender {
[self pageUP:_RectView];
}
@end
Read:
How to animate a view or image along a curved path.
How to create a twinkling star background effect in iOS ?
Some important points About View Controller.
What Are The Main Responsibilities Of A View Controller ?
Explain The Difference Between loadView() And viewDidLoad() in iOS
How To Explain UIViewController Life Cycle in iOS ?

animationtransitioncurldown.zip |