admin管理员组文章数量:1317909
How is the right way to present the flutterViewController if the initial view controller ist another view controller (for example SplashViewController)?
I present the flutterViewController from the SplashViewController (rootViewController):
public class SplashViewController: UIViewController {
public override func viewDidLoad() {
super.viewDidLoad()
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let flutterEngine = appDelegate.flutterEngine
let flutterViewController =
FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)
flutterViewController.modalPresentationStyle = .overCurrentContext
flutterViewController.isViewOpaque = false
appDelegate.window?.rootViewController?.present(flutterViewController, animated: true, completion: nil)
This is working but the flutterViewController is now on the top of the stack of both viewControllers (1. SplashViewController, 2. FlutterViewController).
I ask me if this is the right way or if I have to dismiss the SplashViewController so that there are no problems with other ViewControllers such as MFMailComposeViewController if I open it later from my Flutter app.
Thanks for your help!
本文标签: swiftPresent flutterViewController and dismiss old rootViewControllerStack Overflow
版权声明:本文标题:swift - Present flutterViewController and dismiss old rootViewController - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742005319a2411836.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论