简体   繁体   English

Swift 3:让按钮呈现在ViewController中,怎么办?

[英]Swift 3: make button present ViewController, how?

I would like my button to reshow the user my on boarding screen since it includes some important instructions to my app. 我希望我的按钮可以在登机屏幕上向用户显示我的按钮,因为它包含一些对我的应用程序的重要说明。 The first time I show my onboarding screen is after the first launch; 我第一次显示入职屏幕是在第一次启动后; My current function looks like this: 我当前的函数如下所示:

@IBAction func anleitung(sender: RoundButtons) {

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

}

This is actually like the 4th way I tried this, but, apparently, none of them worked. 实际上,这就像我尝试此操作的第四种方法,但是显然,它们都不起作用。 Do you know how to do that? 你知道怎么做吗?

Thanks for having a look! 感谢您的光临! Have a great day! 祝你有美好的一天!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM