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

SceneDelegate 不能出现 #219

Open
kou8910 opened this issue Aug 24, 2020 · 6 comments
Open

SceneDelegate 不能出现 #219

kou8910 opened this issue Aug 24, 2020 · 6 comments

Comments

@kou8910
Copy link

kou8910 commented Aug 24, 2020

swift5 iOS13之后,有SceneDelegate,导致Whisper
`let murmur = Murmur(title: "This is a permanent whistle...",
backgroundColor: UIColor.red,
titleColor: UIColor.white)

    Whisper.show(whistle: murmur, action: .present)`

失效,无法显示

@3lvis
Copy link
Collaborator

3lvis commented Oct 4, 2020

Strange @kou8910, can you reproduce it in the demo project?

@kou8910
Copy link
Author

kou8910 commented Nov 18, 2020

[
WhisperDome.zip
](url)

@kou8910
Copy link
Author

kou8910 commented Nov 18, 2020

` let murmur = Murmur(title: "This is a permanent whistle...",
backgroundColor: UIColor.red,
titleColor: UIColor.white)

    Whisper.show(whistle: murmur, action: .present)`

let murmur = Murmur(title: "This is a small whistle...", backgroundColor: UIColor(red: 0.975, green: 0.975, blue: 0.975, alpha: 1))
不起作用

@kou8910
Copy link
Author

kou8910 commented Nov 18, 2020

奇怪的@ kou8910,可以在演示项目中重现吗?

已经上传 你看下

@kou8910
Copy link
Author

kou8910 commented Nov 25, 2020

找到问题了
iOS 13 之前
var whistleWindow: UIWindow = UIWindow()
iOS 13 之后 需要改成
if #available(iOS 13.0, *) { if let firstScene: UIWindowScene = UIApplication.shared.connectedScenes.filter({ $0.activationState == .foregroundActive }).first as? UIWindowScene { whistleWindow = UIWindow(windowScene: firstScene) } else { whistleWindow = UIWindow() } } else { whistleWindow = UIWindow() }
解决了这个问题,希望更新下

@3lvis
Copy link
Collaborator

3lvis commented Nov 25, 2020

Thanks @kou8910!

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

2 participants