Swift 3:使按钮呈现 ViewController,如何?

Swift 3: make button present ViewController, how?

我希望我的按钮能够向用户重新显示我的登机屏幕,因为它包含一些对我的应用程序的重要说明。 我第一次展示我的引导屏幕是在第一次启动之后; 我当前的函数如下所示:

@IBAction func anleitung(sender: RoundButtons) {

    let appDelegate = AppDelegate()
    appDelegate.window?.rootViewController?.present(OnboardingScreen(), animated: true, completion: nil)

}

这实际上就像我尝试的第 4 种方法,但显然,none 其中的方法奏效了。你知道怎么做吗?

感谢观看!祝你有美好的一天!

@IBAction func anleitung(sender: RoundButtons) {
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    appDelegate.window?.rootViewController?.present(OnboardingScreen(), animated: true, completion: nil)
}