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

Version 8.0.4 is causing a crash #446

Closed
fabdurso opened this issue Dec 20, 2020 · 2 comments
Closed

Version 8.0.4 is causing a crash #446

fabdurso opened this issue Dec 20, 2020 · 2 comments

Comments

@fabdurso
Copy link

fabdurso commented Dec 20, 2020

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:

  • show a SwiftMessage (called in viewWillAppear) with the follow config:
alertConfig.presentationStyle = .center
alertConfig.duration = .forever
alertConfig.dimMode = .color(color: .clear, interactive: true)
  • close the SwiftMessage by tapping outside the alert
  • click on the button that should open a SCLAlertView

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
Copy link
Member

wtmoose commented Dec 20, 2020

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
Copy link
Author

Thanks @wtmoose!
8.0.5 fixed the issue.

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