Skip to content

Instantly share code, notes, and snippets.

@binderclip
Created March 25, 2015 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binderclip/4811a139045e52a91cd9 to your computer and use it in GitHub Desktop.
Save binderclip/4811a139045e52a91cd9 to your computer and use it in GitHub Desktop.
iOS 创建空工程,不使用 Storyboard
// 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