You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我在使用CocoaDebug和URLNavigator 开发程序时,H5 全屏播放视频,返回
if let windowRootViewController = window.rootViewController, window.isKeyWindow {
rootViewController = windowRootViewController
break
}
这个地方获取的rootViewController 就不是项目内的控制器了,isKeyWindow可能是alert 级别的window,所以个人感觉这样获取的keyWindow比较合适:
var keyWindow: UIWindow? = nil
let windows = UIApplication.shared.windows
for tmp in windows{
if tmp.windowLevel == UIWindow.Level.normal{
keyWindow = tmp
break
}
}
var rootVC = keyWindow?.rootViewController
The text was updated successfully, but these errors were encountered:
我在使用CocoaDebug和URLNavigator 开发程序时,H5 全屏播放视频,返回
if let windowRootViewController = window.rootViewController, window.isKeyWindow {
rootViewController = windowRootViewController
break
}
这个地方获取的rootViewController 就不是项目内的控制器了,isKeyWindow可能是alert 级别的window,所以个人感觉这样获取的keyWindow比较合适:
var keyWindow: UIWindow? = nil
let windows = UIApplication.shared.windows
for tmp in windows{
if tmp.windowLevel == UIWindow.Level.normal{
keyWindow = tmp
break
}
}
var rootVC = keyWindow?.rootViewController
The text was updated successfully, but these errors were encountered: