since I've been unable to do even one succesfull merge with storyboard, I'm trying to switch to xib files. I'm trying to set one xib file as initialViewController as you do in storyboard, so first I've disabled that property in storyboard. Following some examples from google, I've made an extension that is supposed to return a xib file:
extension UIViewController {
class func loadFromNibNamed(nibNamed: String, bundle : NSBundle? = nil) -> UIViewController? {
return UINib(
nibName: nibNamed,
bundle: bundle
).instantiateWithOwner(nil, options: nil)[0] as? UIViewController
}
and then called that class function from the app delegate and try to load the xib file as root view controller like this:
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let mainView = UIViewController.loadFromNibNamed("MainView")
//window?.addSubview(mainView!)
self.window?.rootViewController = mainView
return true
}
My xib file name is MainView.xib, I have a UIView and a MainViewController on it, MainViewController inherits from ViewController and it's still empty:
Whatever I try I allways get the same error message:
Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?