Is it possible to create an application that loads its initial view from a storyboard in a framework?
Let's say I have a framework, titled MyCoolFramework. This framework has a storyboard called Home.storyboard that is the initial view of an application.
Is there a way to load it into the application at launch? My AppDelegate looks like this:
import UIKit
import MyCoolFramework
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let bundle = NSBundle(identifier: "com.myprojects.MyCoolFramework")
let homeStoryboard = UIStoryboard(name: "Home", bundle: bundle)
let initialView = homeStoryboard.instantiateInitialViewController()
self.window?.rootViewController = initialView
self.window?.makeKeyAndVisible()
return true
}
}
It seems that at this point in the application the application does not have access to the framework or its contents. Anyone know of the proper way of doing this? This is the companion test-app for a framework I'm developing.
I have deleted the main storyboard directive in the info.plist