How to push another view using cube style animation in iPhone.

Hello everyone, 

How are you doing? Hope everyone is fine and well, I need to share some simple thing which is not quite used, however i have found it interesting in doing this. When we need to go another view by simply clicking any button or tableview in cell, we just called push controller and it worked. However if you want some kind of animation stuff like your view should appear in cube style below is the sample code. I have used that code on button click to display another view

commonView = [[CommonViewController alloc] initWithNibName:@”CommonViewController” bundle:nil];

    CATransition *transition = [CATransition animation];

    transition.duration = 1;

    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

    transition.type = @”cube”;

    transition.subtype = kCATransitionFromBottom;

    transition.delegate = self;

    [self.navigationController.view.layer addAnimation:transition forKey:nil];

    self.navigationController.navigationBarHidden = NO;

    [self.navigationController pushViewController:commonView animated:YES];      

 

Thts the only thing you will need to do and your next view will show in cube style. Hope you will like it. Feedback are always welcom

About these ads

3 thoughts on “How to push another view using cube style animation in iPhone.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s