我有一个名为FirstViewController.swift的UIViewController
类,我想在AppDelegate.swift中导入我的app,命名为MySample.How,以便在AppDelegate.swift中导入UIViewController.swift。我用Google搜索但无法找到有效的答案。
提前致谢。
答案 0 :(得分:0)
试用此代码:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String, annotation: AnyObject?) -> Bool {
var rootViewController = self.window!.rootViewController as UINavigationController
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
var FirstViewController = mainStoryboard.instantiateViewControllerWithIdentifier("StoryBoardID") as FirstViewController
rootViewController.pushToViewController(FirstViewController, animated: true)
return true
}