Przeglądaj źródła

1.修改iOS RedAnt Mobile Result Cell点击事件处理。

Pen Li 8 lat temu
rodzic
commit
7c6b7b9c57
2 zmienionych plików z 33 dodań i 39 usunięć
  1. 33 33
      common/customUI/ResultCell.m
  2. 0 6
      common/customUI/ResultViewController.m

+ 33 - 33
common/customUI/ResultCell.m

@@ -29,44 +29,44 @@
 
     // Configure the view for the selected state
 }
-//
-//- (void)touch:(NSSet<UITouch *> *)touches {
-//    if (self.handlingTouch) {
-//        return;
-//    }
-//    UITouch *touch = [[touches allObjects] lastObject];
-//    if (self.touchDelegate && [self.touchDelegate respondsToSelector:@selector(touchedCell:withForce:)]) {
-//        self.handlingTouch = YES;
-//        [self.touchDelegate touchedCell:self withForce:touch.force];
-//    }
-//}
-//
-//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
+
+- (void)touch:(NSSet<UITouch *> *)touches {
+    if (self.handlingTouch) {
+        return;
+    }
+    UITouch *touch = [[touches allObjects] lastObject];
+    if (self.touchDelegate && [self.touchDelegate respondsToSelector:@selector(touchedCell:withForce:)]) {
+        self.handlingTouch = YES;
+        [self.touchDelegate touchedCell:self withForce:touch.force];
+    }
+}
+
+- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
 //    if (self.touchColor) {
 //        _normalBGColor = self.backgroundColor;
 //        self.backgroundColor = self.touchColor;
 //    }
-//    
-////    [super touchesBegan:touches withEvent:event];
-//    self.handlingTouch = NO;
-//    [self touch:touches];
-//}
-//
-//- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
-////    [super touchesMoved:touches withEvent:event];
-//    [self touch:touches];
-//}
-//
-//- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
+    
+    [super touchesBegan:touches withEvent:event];
+    self.handlingTouch = NO;
+    [self touch:touches];
+}
+
+- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
+    [super touchesMoved:touches withEvent:event];
+    [self touch:touches];
+}
+
+- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
 //    self.backgroundColor = _normalBGColor;
-////    [super touchesEnded:touches withEvent:event];
-//    [self touch:touches];
-//}
-//
-//- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
+    [super touchesEnded:touches withEvent:event];
+    [self touch:touches];
+}
+
+- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
 //    self.backgroundColor = _normalBGColor;
-////    [super touchesCancelled:touches withEvent:event];
-//    [self touch:touches];
-//}
+    [super touchesCancelled:touches withEvent:event];
+    [self touch:touches];
+}
 
 @end

+ 0 - 6
common/customUI/ResultViewController.m

@@ -691,12 +691,6 @@ const int delta = 25;
     int option = 0;
     if ([refresh isEqual:self.tableview.jl_header]) {
         option = 1;
-        
-        
-        
-
-        
-        
     }
     if (refresh == self.tableview.jl_footer) {
         if(refresh.state==JLRefreshStateNoMore) //数据取完不再加载