URLNavigator
URLNavigator copied to clipboard
Push will be invalid
if app have Multiple windows,
navigator.push("")
will be invaild
I think that should modify UIViewController. topMost
code:
let currentWindows = UIApplication.shared.keyWindow
if let windowRootViewController = currentWindows?.rootViewController {
rootViewController = windowRootViewController
}
// for window in currentWindows {
// if let windowRootViewController = window.rootViewController {
// rootViewController = windowRootViewController
// break
// }
// }
Can I have a sample project that has the bug?
i have the same pro because my app have 2 windonws in sharedApplication?.windows i think ,you need find the keywindow
UIViewController+TopMostViewController.swft: line 15: , window.isKeyWindow
open class var topMost: UIViewController? {
guard let currentWindows = self.sharedApplication?.windows else { return nil }
var rootViewController: UIViewController?
for window in currentWindows {
if let windowRootViewController = window.rootViewController, window.isKeyWindow {
rootViewController = windowRootViewController
break
}
}
return self.topMost(of: rootViewController)
}
I had the same problem,push Sometimes return nil.
do't set MainInterface
That is right,https://github.com/devxoul/URLNavigator/issues/114 Can you help me? thank you