Pondpoud
Pondpoud

Reputation: 61

Adding additional time to Launch Screen

#import "RecipeBookViewController.h"
#import "RecipeDetailViewController.h"
#import "RecipeIngredientViewController.h"
#import "RecipeInstructionViewController.h"
#import "Recipe.h"

@interface RecipeBookViewController ()

@end

@implementation RecipeBookViewController {
    NSArray *recipes;
}

@synthesize tableView = _tableView;

- (void)viewDidLoad
{
    [super viewDidLoad];
}

Is there anyway for me to add a second for the launch screen to appear longer? Where would I add the code?

Upvotes: 2

Views: 44

Answers (3)

Daniel Storm
Daniel Storm

Reputation: 18898

Add sleep(numberOfSeconds) to application didFinishLaunchingWithOptions in your AppDelegate.h.

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    sleep(10);
    return YES;
}

Although, Apple suggests that you should not do this with your launch images.

iOS Human Interface Guidelines: Because users are likely to switch among apps frequently, you should make every effort to cut launch time to a minimum, and you should design a launch image that downplays the experience rather than drawing attention to it.

Upvotes: 0

Rufel
Rufel

Reputation: 2660

You could display a UIViewController with a full size UIImageView holding your splash image as your UIWindow's rootViewController.

In your viewDidAppear, have a method that change that UIViewController being called with a performSelector:afterDelay:

[self performSelector:@selector(changeViewControllerMethod) withObject:nil afterDelay:5.0];

Upvotes: 1

Malav Soni
Malav Soni

Reputation: 2848

Try to use sleep method in root view controller's viewDidLoad Method.

sleep("seconds")

This will pause further execution for the seconds you passed.

Upvotes: 0

Related Questions