Question

My app gives the shuttle schedule for my school's shuttle bus, and I am updating the app to check what day of the year it is, and if it is summer to display the summer schedule, which is different from the normal schedule. That part's easy.

What I'm wondering is if I can choose to use a different launch image based on a programmatic condition, such as:

if ( today isBetweenDate: juneFirst andDate: augustThirtyFirst ) {
     launchImage == summerLaunchImage.png 
}
Was it helpful?

Solution

The initial launch screen displayed cannot be changed programmatically : you need to provide a single image an tell the app it's the launch screen. You can't change that programmatically.

What you can do is show your own splashscreen after the launch screen when you app gain the focus in didFinishLaunchingWithOptions of your UIApplicationDelegate

OTHER TIPS

As others have said implement your own launcher screen. The easiest way to do is is to put an NSTimer that will move it automatically to your next screen after X number of seconds.

Here's some sample code.

In *.h

@interface v2ViewController : UIViewController
{
    NSTimer *timer1;
    NSTimer *timer2;

    IBOutlet UIImageView *backgroundImgVw;

}

In *.m

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

//set your backgroundImgVw / Launch Image here

//then move on
    timer2 = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(moveOn) userInfo:nil repeats:NO];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (IBAction) moveOn
{
    //Now go to the Display Call Page
    [self performSegueWithIdentifier:@"MoveOn" sender:nil];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top