redth-org / BTProgressHUD

Port to Xamarin.iOS of the SVProgressHUD
Other
118 stars 64 forks source link

Get window from ConnectedScenes on iOS 13 and up #85

Closed Cheesebaron closed 3 years ago

Cheesebaron commented 3 years ago

:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bugfix

:arrow_heading_down: What is the current behavior?

Dismiss sometimes crashes on iOS 15 according to the linked ticket.

:new: What is the new behavior (if this is a feature change)?

The issue is that we are using a deprecated method to get the window, and the new recommended way is to find the appropriate scene to show the HUD in instead.

I now iterate over the ConnectedScenes and try to find the scene with a Key Window.

:boom: Does this PR introduce a breaking change?

Nope, added a fallback on iOS versions older than 13, that falls back to using SharedApplication.Windows to get the key window.

:bug: Recommendations for testing

Try running on iOS 12, 13 and 15

:memo: Links to relevant issues/docs

Fixes #84

:thinking: Checklist before submitting