Skip to content

Instantly share code, notes, and snippets.

@lamprosg
Created June 14, 2018 18:04
Show Gist options
  • Select an option

  • Save lamprosg/cdf90a81217e299d5f6ee17cee15d549 to your computer and use it in GitHub Desktop.

Select an option

Save lamprosg/cdf90a81217e299d5f6ee17cee15d549 to your computer and use it in GitHub Desktop.
(iOS) Root XIB instead of storyboard
//Delete main storyboard
//Delete it from target - General - Deployment info - Main interface
//Delete derived data
// In appDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let homeViewController = ViewController()
window!.rootViewController = homeViewController
window!.makeKeyAndVisible()
return true
}
//In your VC
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: "View", bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment