Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:51:22+00:00 2026-06-11T22:51:22+00:00

I have 2 ViewControllers and I create one UIImageView to show like Splash Screen

  • 0

I have 2 ViewControllers and I create one UIImageView to show like Splash Screen on IPhone. I write it in TestAppDelegate.m :

====================

splashScreen = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

splashScreen.image = [UIImage imageNamed:@"Default.png"];

[self.window addSubview:splashScreen];

 sleep(6);

[splashScreen removeFromSuperview];

====================

My question is,

if I touch on this imageview I will go to 2nd ViewController.

else after time sleep, automatically to 1st ViewController.

So, it’s possible to do that ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:51:23+00:00Added an answer on June 11, 2026 at 10:51 pm

    Do this:

    Add UIGestureRecognizerDelegate in appDelegate.h file.

    @interface AppDelegate : UIResponder <UIApplicationDelegate,UIGestureRecognizerDelegate>
    

    Now

    splashScreen = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    splashScreen.userInteractionEnabled = YES;
    splashScreen.image = [UIImage imageNamed:@"Default.png"];
    UITapGestureRecognizer* tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
    tapRecognizer.numberOfTapsRequired = 1;
    tapRecognizer.numberOfTouchesRequired = 1;
    tapRecognizer.delegate = self;
    [splashScreen addGestureRecognizer:tapRecognizer];
    [tapRecognizer release];
    
    [self.window addSubview:splashScreen];
    
    sleep(6);
    [splashScreen removeFromSuperview];
    //add ViewController1 here
    ViewController1 *objViewController1 = [[ViewController1 alloc]initWithNibName:@"ViewController1" bundle:nil];
    [self.window addSubview:objViewController1.view];
    

    Now handler will be called when tapped on splash screen

    - (void)handleTap:(UITapGestureRecognizer*)recognizer
    {
       // Do Your thing. 
       if (recognizer.state == UIGestureRecognizerStateEnded)
       {
         [splashScreen removeFromSuperview]; //edited here
         ViewController2 *objViewController2 = [[ViewController2 alloc]initWithNibName:@"ViewController2" bundle:nil];
        [self.window addSubview:objViewController2.view];
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have NSXMLParser working in my viewcontroller. I would like to create a
I have an iPhone application that is mostly using standard controls. There is one
I have 7 ViewControllers in an app, one of which loads a local PDF
I am trying to create an app for the iPhone and I have a
I have 2 viewcontrollers and I want to send a notification out from one
Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
I have a tabBar application. In the app delegate i create one NSMutableArray, one
I have 4 buttons on main screen, each one sends me to a viewController.
I would like to create a page similar to the one where the user
I have created two viewController classes such that one is superclass of another.i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.