Whisper icon indicating copy to clipboard operation
Whisper copied to clipboard

SceneDelegate 不能出现

Open kou8910 opened this issue 4 years ago • 6 comments

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

失效,无法显示

kou8910 avatar Aug 24 '20 08:08 kou8910

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

3lvis avatar Oct 04 '20 09:10 3lvis

[ WhisperDome.zip ](url)

kou8910 avatar Nov 18 '20 21:11 kou8910

` 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 avatar Nov 18 '20 21:11 kou8910

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

已经上传 你看下

kou8910 avatar Nov 18 '20 21:11 kou8910

找到问题了 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() } 解决了这个问题,希望更新下

kou8910 avatar Nov 25 '20 04:11 kou8910

Thanks @kou8910!

3lvis avatar Nov 25 '20 22:11 3lvis