Search This Blog

Friday, 10 August 2012

How to flip an image in 3D for iPhone

Hello Friends,
                    Sorry for not posting from many days,......actually ii was messing up with xcode to rotate an image in 3D without using any Core graphics or something.So here is the code to Rotate a UIImageView in xcode its a good animation for displaying advertisement images in your app.

- (void)viewDidLoad{
[super viewDidLoad];
self.welcomePhotos = [NSArray arrayWithObjects:@"welcome_1.png",@"welcome_2.png", @"welcome_3.png", nil];
self.imageView1.image = [UIImage imageNamed:[self.welcomePhotos objectAtIndex:0]];
[NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(transitionPhotos) userInfo:nil repeats:YES];

if (photoCount < [self.welcomePhotos count] - 1){
    photoCount ++;
    photoCount = 0;
[UIView transitionWithView:self.imageView1
                animations:^{ self.imageView1.image = [UIImage imageNamed:[self.welcomePhotos objectAtIndex:photoCount]]; }
                completion:NULL];    }

Thanx to Anonymous Developer......

Ask for any questions.....

No comments:

Post a Comment