我已经实现了一个 URL 方案,用于在付款后重定向回我的应用程序。当网页直接返回我的应用程序时,该应用程序应该在当前 View 上打开一个导航 Controller 。 (所以打开它模式)。
如何从 func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool
-method 中的 AppDelete 执行此操作?
提前致谢!
最佳答案
您是使用 Storyboard还是在委托(delegate)中手动创建窗口?如果您有权访问该窗口,则可以执行以下操作:
window?.rootViewController?.present(yourViewController, animated: true, completion: nil)
否则,它应该适用于所有情况:
UIApplication.shared.keyWindow?.rootViewController?.present(yourViewController, animated: true, completion: nil)
关于ios - 从 App Delegate 打开导航 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46472218/