我正在寻找一种使用Storyboard以编程方式设置我的初始视图控制器的方法。我发现这个解决方案:Programmatically set the initial view controller using StoryboardsSwiftSpinner不再工作
这个作品只是喜欢我想它,但使用该主题中提供的斯威夫特后回答:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
var exampleViewController: ExampleViewController = mainStoryboard.instantiateViewControllerWithIdentifier("ExampleController") as! ExampleViewController
self.window?.rootViewController = exampleViewController
self.window?.makeKeyAndVisible()
return true
}
当装载了第一次用于工作框架图将不再工作:SwiftLoader。 https://github.com/leoru/SwiftLoader
但是,当我第二次加载相同的视图时,SwiftLoader插件没有激活。
我加载SwiftLoader像这样:
SwiftLoader.show(title: "Loading...", animated: true)
我认为它与代码做上面创建的UIWindow,而不是任何脚本中使用到的感觉(UIView的?)做的,但我不想法如何解决这个问题?
当您显示指标视图时,您能否就您的问题报告部分代码? – LuckyStarr