Narendra Pandey Narendra Pandey - 1 year ago 155
Objective-C Question

Splash screen in ios

Please suggest me that how to create splash screen in iphone for some interval. i have tried to update in info.plist by creating a new resources Launch image But not working.
I have tried this

#import "AppDelegate.h"
#import "SignIn.h"
#import "Splash.h"

@interface AppDelegate ()


@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.

self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
Splash *splash=[[Splash alloc]initWithNibName:@"Splash" bundle:nil];
[self.window makeKeyAndVisible];
SignIn *signIn=[[SignIn alloc]initWithNibName:@"SignIn" bundle:nil];
return YES;

Answer Source

To present a view controller automatically after sometime add NSTimer in viewDidLoad of the splash screen controller which you are presenting.

- (void)viewDidLoad

//NSTimer calling Method B
[NSTimer scheduledTimerWithTimeInterval:5.0f 
target:self selector:@selector(methodB:) userInfo:nil repeats:NO];

- (void) methodB:(NSTimer *)timer
//Present next view controller.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download