Created
August 20, 2016 09:14
-
-
Save haxpor/9ec0a7ba145d717be041cfc9dd4dde63 to your computer and use it in GitHub Desktop.
Code to manually create UIWindow, and UIViewController with customized UIView without involving with Interface Builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// Override point for customization after application launch. | |
CGRect screenRect = [UIScreen mainScreen].bounds; | |
self.window = [[UIWindow alloc] initWithFrame:screenRect]; | |
GLView *glView = [[GLView alloc] initWithFrame:screenRect]; | |
UIViewController *rootVc = [[UIViewController alloc] init]; | |
[rootVc.view addSubview:glView]; | |
self.window.rootViewController = rootVc; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment