Skip to content

Commit

Permalink
Fix superview issue on iOS (#198)
Browse files Browse the repository at this point in the history
Co-authored-by: Aditya Pahilwani <[email protected]>
  • Loading branch information
AdityaPahilwani and AdityaPahilwaniGroww authored May 9, 2023
1 parent 6cca4d8 commit 5d44f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios/RNSnackBarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void)buildView {
CGFloat bottomPadding = topPadding;

if (@available(iOS 11.0, *)) {
UIWindow *window = UIApplication.sharedApplication.keyWindow;
UIWindow *window = [[UIApplication sharedApplication] delegate].window;

if (window.safeAreaInsets.bottom > bottomPadding)
bottomPadding = window.safeAreaInsets.bottom;
Expand Down Expand Up @@ -182,7 +182,7 @@ - (void)actionPressed:(UIButton *)sender {
- (void)presentWithDuration:(NSNumber *)duration {
_pendingOptions = nil;
_pendingCallback = nil;
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
UIWindow *keyWindow = [[UIApplication sharedApplication] delegate].window;
[keyWindow addSubview:self];
[self setTranslatesAutoresizingMaskIntoConstraints:false];
[keyWindow addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[self(>=48)]|"
Expand Down

0 comments on commit 5d44f84

Please sign in to comment.