cooperka / react-native-snackbar

:candy: Material Design "Snackbar" component for Android and iOS.
Other
823 stars 152 forks source link

Fix superview issue on iOS #198

Closed AdityaPahilwani closed 1 year ago

AdityaPahilwani commented 1 year ago

Fixes #192

current the lib access UIWindow access by UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; and was deprecated in ios 15 and can return nil https://developer.apple.com/forums/thread/695932 and when I debugged this and passed UIWindow *keyWindow = nil; it threw the exact error Unable to parse constraint format: Unable to interpret '|' character, because the related view doesn't have a superview V:[self(>=48)]| ^

By accessing UIWindow by UIWindow *keyWindow = [[UIApplication sharedApplication] delegate].window; which would point to the window of AppDelegagte.

We didn't saw any crash reports after this fix.

savv commented 1 year ago

@cooperka, many thanks for this library! What about merging this and making a new release?

cooperka commented 1 year ago

thanks for the fix and documentation, @AdityaPahilwani! i will merge and release as a minor (rather than patch) version bump since i have not been able to verify whether or not this change may break earlier versions. it likely does not.