Skip to content

Instantly share code, notes, and snippets.

@ShingoFukuyama
Created August 18, 2017 23:30
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 ShingoFukuyama/23be9ee6e49234b4356801f3f701e157 to your computer and use it in GitHub Desktop.
Save ShingoFukuyama/23be9ee6e49234b4356801f3f701e157 to your computer and use it in GitHub Desktop.
iOS project without storyboard. AppDelegate.swift
/*
1. Delete `main.storyboard`
2. Emptify `Main Interface` on the project's general page
3. Add below code inside `application:didFinishLaunchingWithOptions`
*/
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.main.bounds)
if let window = self.window {
let viewController = ViewController()
window.rootViewController = viewController
window.backgroundColor = UIColor.white
window.makeKeyAndVisible()
}
return true
}
.
.
.
@fitsyu
Copy link

fitsyu commented Sep 20, 2018

nice, but UIScreen.main.bounds seems producing quite smaller window on screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment