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

Topmost does not return the right UIViewController #158

Open
Bruno-Clairet opened this issue Jun 9, 2022 · 0 comments
Open

Topmost does not return the right UIViewController #158

Bruno-Clairet opened this issue Jun 9, 2022 · 0 comments

Comments

@Bruno-Clairet
Copy link

If the app uses a AVPictureInPictureController, the topmost method does not return the right UIViewController. When the video starts playing the AVPictureInPictureController creates two extra UIWindow.

var rootViewController: UIViewController?
let currentWindows = UIApplication.shared.windows

for window in currentWindows {
  if let windowRootViewController = window.rootViewController {
    rootViewController = windowRootViewController
    break
  }
}

The first UIWindow is not the key window, it is created by the Picture in Picture View Controller.

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

1 participant