Vous êtes sur la page 1sur 2

#define HEIGHT_IPHONE_5 568

#define IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] ==


UIUserInterfaceIdiomPhone)
#define IS_IPHONE_5 ([[UIScreen mainScreen] bounds ].size.height ==
HEIGHT_IPHONE_5 )
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UIStoryboard *mainStoryboard = nil;
if ([[UIDevice currentDevice] userInterfaceIdiom] ==
UIUserInterfaceIdiomPhone)
{
if(IS_IPHONE_5)
{
mainStoryboard = [UIStoryboard
storyboardWithName:@"MainStoryboard_iPhone5" bundle:nil];
}
else
{
mainStoryboard = [UIStoryboard
storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
}
}
else
{
mainStoryboard = [UIStoryboard
storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]
bounds]];
self.window.rootViewController = [mainStoryboard
instantiateInitialViewController];
[self.window makeKeyAndVisible];
return YES;
}

prefs = [NSUserDefaults standardUserDefaults];

AppDelegate *appdelegate=[[UIApplication sharedApplication] delegate];

NSUserDefaults *prefs = [NSUserDefaults


standardUserDefaults];
if (![prefs objectForKey:@"installation_date"]) {
NSDate *now = [NSDate date];

[prefs setObject:now forKey:@"installation_date"];


}
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
if(networkStatus != NotReachable)
{

Vous aimerez peut-être aussi