Powered by
Powered by
HuntMyIdeas-Inspire You To Make It Happen
Follow
   Me
  • Blogs
  • About Me
  • Home

Animating a UIView to curl down,curl up,curl right,curl left

6/20/2014

0 Comments

 
Picture
Animation in iPhone Apps is one of the finest part to draw attention of users.

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 this UIView tutorial, you’ll get a small portion of UIView animation to create a neat little app about UIView curl down,curl up,curl right,curl left.

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 Project:

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

Picture
ViewController.m

#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
Here is a sample project with all of the code we’ve developed in the above UIView Slide Animation tutorial.

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
File Size: 118 kb
File Type: zip
Download File

0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Delivered by FeedBurner

    RSS Feed

    Archives

    December 2019
    August 2018
    January 2018
    December 2017
    November 2017
    October 2017
    August 2017
    April 2017
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014


    ​​Categories

    All
    Affiliate Marketing
    Alexa Rank
    Apple's Latest Updates
    Blog Tips
    Cocos2d X
    Cocos2d-x
    Google AdSense Tips
    Grab-some-ultimate-ideas
    How-to-create-a-twinkling-star-background-effect-in-ios
    In-App Purchase Tutorial In Cocos2d-x (C++) Using SDKBOX
    Ios Interview Questions And Answers
    IOS Multiple Choice Questions And Answers
    Objective C
    Online Business
    Python
    Secrets To Effective IPhone App Marketing
    SEO Tips
    Swift Interview Questions
    Swift Tutorials
    Top 10 Articles Objective C
    Top 10 Articles-Objective-C
    Top 10 Popular Movies Ever
    Top 10 Popular Things To Know
    Top 10 Ultimate Issues Xcode
    Top 400 IOS Interview Questions
    Top IOS Sample Projects To Learn From
    Top Secrets To App Marketing
    UICollectionView
    Unity 3D
    Xcode

WELCOME TO HUNTMYIDEAS

Picture
I am Jitendra Gochhayat,an iOS Developer,Designer,blogger,
​from Odisha,India.
I write about ​​​blog tips and,
Make money online Tips,
​Objective C tutorials
SUSCRIBE TO NEWSLETTER

    Subscribe to this blog and receive notifications of new posts by email

Suscribe
Picture
Picture
Picture
Picture
Picture
HuntMyIdeas-2016 Powered By Weebly
Picture
Powered by Create your own unique website with customizable templates.
Powered by
Powered by