| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // ResultCell.m
- // Apex Mobile
- //
- // Created by Jack on 2018/2/14.
- // Copyright © 2018年 United Software Applications, Inc. All rights reserved.
- //
- #import "ResultCell.h"
- @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.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
|