浏览代码

Enable Swipedown to dismiss on bottom aligned notification iOS (#2567)

Michael Kuczera 6 年前
父节点
当前提交
05f723122f
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2
    4
      ios/RCCNotification.m

+ 2
- 4
ios/RCCNotification.m 查看文件

@@ -66,12 +66,10 @@
66 66
 
67 67
 -(UISwipeGestureRecognizerDirection)swipeDirection
68 68
 {
69
-    UISwipeGestureRecognizerDirection direction = UISwipeGestureRecognizerDirectionUp;
69
+    UISwipeGestureRecognizerDirection direction = [self isBottomPosition] ?  UISwipeGestureRecognizerDirectionDown : UISwipeGestureRecognizerDirectionUp;
70 70
     
71 71
     NSString *animationType = [self.params valueForKeyPath:@"animation.type"];
72
-    if ([animationType isEqualToString:@"swing"] || [animationType isEqualToString:@"slide-down"])
73
-        direction = UISwipeGestureRecognizerDirectionUp;
74
-    else if ([animationType isEqualToString:@"slide-left"])
72
+    if ([animationType isEqualToString:@"slide-left"])
75 73
         direction = UISwipeGestureRecognizerDirectionRight;
76 74
     else if ([animationType isEqualToString:@"slide-right"])
77 75
         direction = UISwipeGestureRecognizerDirectionLeft;