Created
March 25, 2015 08:08
-
-
Save binderclip/4811a139045e52a91cd9 to your computer and use it in GitHub Desktop.
iOS 创建空工程,不使用 Storyboard
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
// First Config: target -> general -> Deployment Info -> Main Interface (Clear!) | |
// Then can move the Main.storyboard | |
// Only ViewController | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
ViewController *viewController = [[ViewController alloc] init]; | |
self.window.rootViewController = viewController; | |
[self.window makeKeyAndVisible]; | |
// With Navigation Controller | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
ViewController *viewController = [[ViewController alloc] init]; | |
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; | |
self.window.rootViewController = navigationController; | |
[self.window makeKeyAndVisible]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment