Search code examples
iosanimationsplash-screen

iphone Animation in SplashScreen


I successfully created an animation for splash screen with this code:

[super viewDidLoad];
AnimationimageView.animationImages = [NSArray arrayWithObjects:
                                      [UIImage imageNamed:@"splash1.png"],
                                      [UIImage imageNamed:@"splash2.png"],
                                      [UIImage imageNamed:@"splash3.png"],
                                      [UIImage imageNamed:@"splash4.png"], nil];

[AnimationimageView setAnimationRepeatCount:1];
AnimationimageView.animationDuration=3;
[AnimationimageView startAnimating];

I connected this code with my storyBoard.

My question is how I can know if the animation is finished in order to pass to the other view.


Solution

  • Lets try this code

    call this function in viewDidLoad

     [self performSelector:@selector(gotoNextView) withObject:nil afterDelay:3];
    

    create a method

    -(void)gotoNextView
    {
    // move to next view code
    
    }