Просмотр исходного кода

1.修改iOS RedAnt Mobile Result Cell点击状态。

Pen Li 8 лет назад
Родитель
Сommit
ee2dbaae87
3 измененных файлов с 11 добавлено и 6 удалено
  1. 0 1
      common/customUI/ResultCell.h
  2. 11 4
      common/customUI/ResultCell.m
  3. 0 1
      common/customUI/ResultViewController.m

+ 0 - 1
common/customUI/ResultCell.h

@@ -19,7 +19,6 @@
 @interface ResultCell : UITableViewCell
 @interface ResultCell : UITableViewCell
 
 
 @property (nonatomic,weak) id<ResultCellTouchDelegate> touchDelegate;
 @property (nonatomic,weak) id<ResultCellTouchDelegate> touchDelegate;
-@property (nonatomic,assign) BOOL handlingTouch;
 @property (nonatomic,strong) UIColor *touchColor;
 @property (nonatomic,strong) UIColor *touchColor;
 
 
 @end
 @end

+ 11 - 4
common/customUI/ResultCell.m

@@ -8,6 +8,12 @@
 
 
 #import "ResultCell.h"
 #import "ResultCell.h"
 
 
+@interface ResultCell ()
+
+@property (nonatomic,assign) BOOL handlingTouch;
+
+@end
+
 @implementation ResultCell
 @implementation ResultCell
 {
 {
     UIColor *_normalBGColor;
     UIColor *_normalBGColor;
@@ -30,6 +36,7 @@
     }
     }
     UITouch *touch = [[touches allObjects] lastObject];
     UITouch *touch = [[touches allObjects] lastObject];
     if (self.touchDelegate && [self.touchDelegate respondsToSelector:@selector(touchedCell:withForce:)]) {
     if (self.touchDelegate && [self.touchDelegate respondsToSelector:@selector(touchedCell:withForce:)]) {
+        self.handlingTouch = YES;
         [self.touchDelegate touchedCell:self withForce:touch.force];
         [self.touchDelegate touchedCell:self withForce:touch.force];
     }
     }
 }
 }
@@ -40,25 +47,25 @@
         self.backgroundColor = self.touchColor;
         self.backgroundColor = self.touchColor;
     }
     }
     
     
-    [super touchesBegan:touches withEvent:event];
+//    [super touchesBegan:touches withEvent:event];
     self.handlingTouch = NO;
     self.handlingTouch = NO;
     [self touch:touches];
     [self touch:touches];
 }
 }
 
 
 - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
 - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
-    [super touchesMoved:touches withEvent:event];
+//    [super touchesMoved:touches withEvent:event];
     [self touch:touches];
     [self touch:touches];
 }
 }
 
 
 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     self.backgroundColor = _normalBGColor;
     self.backgroundColor = _normalBGColor;
-    [super touchesEnded:touches withEvent:event];
+//    [super touchesEnded:touches withEvent:event];
     [self touch:touches];
     [self touch:touches];
 }
 }
 
 
 - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
 - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     self.backgroundColor = _normalBGColor;
     self.backgroundColor = _normalBGColor;
-    [super touchesCancelled:touches withEvent:event];
+//    [super touchesCancelled:touches withEvent:event];
     [self touch:touches];
     [self touch:touches];
 }
 }
 
 

+ 0 - 1
common/customUI/ResultViewController.m

@@ -807,7 +807,6 @@ const int delta = 25;
 - (void)touchedCell:(ResultCell *)cell withForce:(float)force {
 - (void)touchedCell:(ResultCell *)cell withForce:(float)force {
     
     
     if (force > 4.0f) {
     if (force > 4.0f) {
-        cell.handlingTouch = YES;
         // 1519: 普通短震,3D Touch 中 Peek 震动反馈
         // 1519: 普通短震,3D Touch 中 Peek 震动反馈
         // 1520: 普通短震,3D Touch 中 Pop 震动反馈
         // 1520: 普通短震,3D Touch 中 Pop 震动反馈
         // 1521: 连续三次短震
         // 1521: 连续三次短震