Closed petrpavlik closed 2 years ago
Hmm but in that case how do we know what the actual safe area is? Seems like defaulting to 0 would leave users with misaligned alerts?
We're seeing this crash as well, but we still have no idea what causes thekeyWindow
to become nil
. It seems related to iOS 15 indeed.
I'd rather have an occasionally misaligned alert than a crash.
@sberrevoets I'd argue that safe area should be determined from safeArea properties of the view controller that presents the alert, and not the root window. I'd consider this just a hot fix to prevent crashes on iOS 15.
I'd rather have an occasionally misaligned alert than a crash.
That makes sense on an individual level, but by optional chaining it becomes basically impossible to figure out in which situations the behavior changed, whereas if there are useful crash reports with stack traces the underlying problem could potentially be discovered and fixed.
That said, I don't personally feel very strongly one way or another so I'll merge and release this.
We've started seeing crashes on iOS 15 when build using Xcode 13. It looks like
keyWindow
may benil
in certain scenarios (background launch, early in app life cycle?).