Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push will be invalid #104

Open
zhaoyunyi opened this issue Jun 14, 2018 · 5 comments
Open

Push will be invalid #104

zhaoyunyi opened this issue Jun 14, 2018 · 5 comments

Comments

@zhaoyunyi
Copy link

zhaoyunyi commented Jun 14, 2018

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
//      }
//    }
@devxoul
Copy link
Owner

devxoul commented Jun 14, 2018

Can I have a sample project that has the bug?

@cdoky
Copy link

cdoky commented Aug 17, 2018

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)
  }

@nameIsYong
Copy link

I had the same problem,push Sometimes return nil.

@cdoky
Copy link

cdoky commented Nov 7, 2018

do't set MainInterface
main

@nameIsYong
Copy link

That is right,#114 Can you help me? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants