Created
June 14, 2018 18:04
-
-
Save lamprosg/cdf90a81217e299d5f6ee17cee15d549 to your computer and use it in GitHub Desktop.
(iOS) Root XIB instead of 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
| //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