SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 742 forks source link

Version 8.0.4 is causing a crash #446

Closed fabdurso closed 3 years ago

fabdurso commented 3 years ago

I'm using both SwiftMessages (thanks again for the amazing job @wtmoose) and SCLAlertView-Swift. After upgrading to 8.0.4, there's a crash caused by SwiftMessages.

The actual workflow is:

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file SCLAlertView/SCLAlertView.swift, line 714 The crash is on this line let rv = UIApplication.shared.keyWindow! as UIWindow

I see that the crash should be handled by someone at SCLAlertView-Swift, but why is SwiftMessages causing it? It was working fine until version 8.0.3.

wtmoose commented 3 years ago

Can you give 8.0.5 a try?

In your scenario, the message is assuming key window status because you're using a dimming view. 8.0.4 made a change to allow the message view's window to be deallocated on dismissal, but that left your app in a state without a key window. 8.0.5 should fix that be restoring the previous key window on dismissal.

fabdurso commented 3 years ago

Thanks @wtmoose! 8.0.5 fixed the issue.