project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m
branchqmlfrontend
changeset 11408 b894922d58cc
parent 11309 402baa6d4f64
child 12877 00215a7ec5f5
--- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m	Tue Sep 08 19:20:58 2015 +0300
+++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m	Mon Nov 16 22:57:24 2015 +0300
@@ -19,7 +19,7 @@
 
 #import "HedgewarsAppDelegate.h"
 #import "MainMenuViewController.h"
-
+#import "Appirater.h"
 
 @implementation SDLUIKitDelegate (customDelegate)
 
@@ -50,7 +50,18 @@
 }
 
 // override the direct execution of SDL_main to allow us to implement our own frontend
--(void) postFinishLaunch {
+-(void) postFinishLaunch
+{
+    // Setup Appirater
+    [Appirater setAppId:@"391234866"];
+    [Appirater setDaysUntilPrompt:3];
+    [Appirater setUsesUntilPrompt:5];
+    [Appirater setSignificantEventsUntilPrompt:-1];
+    [Appirater setTimeBeforeReminding:1];
+    //[Appirater setDebug:YES];
+    
+    [self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0];
+    
     [[UIApplication sharedApplication] setStatusBarHidden:YES];
 
     self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
@@ -58,7 +69,7 @@
 
     NSString *controllerName = (IS_IPAD() ? @"MainMenuViewController-iPad" : @"MainMenuViewController-iPhone");
     self.mainViewController = [[MainMenuViewController alloc] initWithNibName:controllerName bundle:nil];
-    [self.uiwindow addSubview:self.mainViewController.view];
+    self.uiwindow.rootViewController = self.mainViewController;
     [self.mainViewController release];
 
     [self.uiwindow makeKeyAndVisible];