那里
CardinalMobile SDK 显示 OTP 屏幕,在 OTP 屏幕关闭后,我无法显示从 SVProgressHUD 的加载。
我检查了 rootViewController,它已从 UINavigationController 更改为 UIInputWindowController。
操纵 rootViewController 可能会导致不可预测的行为。
假设SVProgressHUD没有自动找到正确的窗口,您可以手动指定容器视图。
DispatchQueue.main.async {
if let keyWindow = UIApplication.shared.windows.filter({ $0.isKeyWindow }).first {
SVProgressHUD.setContainerView(keyWindow)
SVProgressHUD.show(withStatus: "Loading...")
}
}
对于 iOS 13 及以上版本:
DispatchQueue.main.async {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
if let keyWindow = windowScene.windows.filter({ $0.isKeyWindow }).first {
SVProgressHUD.setContainerView(keyWindow)
SVProgressHUD.show(withStatus: "Loading...")
}
}
}