【发布时间】:2017-05-29 12:04:01
【问题描述】:
我的应用程序有一个应用程序委托,我已将代码放入其中,我需要在委托中的以下方法下在那里:
func application(_ application: UIApplication,
willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool{
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialFrontViewController: ViewController2 = storyboard.instantiateViewController(withIdentifier: "initialFrontRevealController") as! ViewController2
let revealController: RevealViewController = storyboard.instantiateViewController(withIdentifier: "revealVC") as! RevealViewController
revealController.setFront(initialFrontViewController, animated: true)
print("seen command")
return true
}
我的问题是我的打印语句没有打印到控制台,并且当我构建和运行我的应用程序时,我在方法中放置的任何任务都没有真正生效。
到目前为止,我已经尝试了几次内容和设置重置,但都无济于事。任何帮助将不胜感激。
【问题讨论】:
-
我认为您在打印语句之前也有一些错误,但您没有说。否则打印语句不可能不打印。就像您因为使用
as!进行的强制解包而导致崩溃一样
标签: ios swift3 swrevealviewcontroller