| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // ResultCell.m
- // Apex Mobile
- //
- // Created by Jack on 2018/2/14.
- // Copyright © 2018年 United Software Applications, Inc. All rights reserved.
- //
- #import "ResultCell.h"
- @interface ResultCell ()
- @property (nonatomic,assign) BOOL handlingTouch;
- @end
- @implementation ResultCell
- {
- UIColor *_normalBGColor;
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // 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 {
- // 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 {
- // self.backgroundColor = _normalBGColor;
- [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];
- }
- @end
|