Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Show an Animated Splash Screen in iOS?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.67k
    Comment on it

    1. Add an image view in your initial view controller as-UIImageView *animatedSplashScreen;

    2. Set its frame in such a way that its compatible with all the devices as
    animatedSplashScreen  = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];

    3.Add this image view to your main view by adding it as a sub view as-
    [self.view addSubview:animatedSplashScreen];

    4. Create an array which contains those sequence of images,for example you have to animate then u need to have a set of images which contains text as 1.Hello 2.Hello this 3.Hello this is 4.Hello this is animated 5.Hello this is animated splash.

    5. Now we will create two functions-One in which we simply add the images to the array,set animation repeat count,set Animation duration & the other function to simply stop animation & remove the animated sub views from the main view u can check it below.

    -(void)functionOne{
        animatedSplashScreen.animationImages= [NSArray arrayWithObjects:[UIImage imageNamed:@"bolt1.png"],[UIImage imageNamed:@"bolt2.png"],[UIImage imageNamed:@"bolt3.png"],[UIImage imageNamed:@"bolt4.png"],[UIImage imageNamed:@"bolt5.png"], nil];
        animatedSplashScreen.animationRepeatCount=1;
        
        
        animatedSplashScreen.animationDuration=5;
        
        animatedSplashScreen.animationRepeatCount=1;
        animatedSplashScreen.animationDuration=5;
        [animatedSplashScreen startAnimating];
    
        [self performSelector:@selector(hideSplash:) withObject:animatedSplashScreen afterDelay:5.0];
    
    }

    Hiding splash here-

    -(void)hideSplash:(id)object
    {
        UIImageView *animatedImageview = (UIImageView *)object;
        [animatedImageview removeFromSuperview];
    }

    Thanks for reading.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: