ResultCell.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // ResultCell.m
  3. // Apex Mobile
  4. //
  5. // Created by Jack on 2018/2/14.
  6. // Copyright © 2018年 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "ResultCell.h"
  9. @implementation ResultCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  15. [super setSelected:selected animated:animated];
  16. // Configure the view for the selected state
  17. }
  18. - (void)touch:(NSSet<UITouch *> *)touches {
  19. if (self.handlingTouch) {
  20. return;
  21. }
  22. UITouch *touch = [[touches allObjects] lastObject];
  23. if (self.touchDelegate && [self.touchDelegate respondsToSelector:@selector(touchedCell:withForce:)]) {
  24. [self.touchDelegate touchedCell:self withForce:touch.force];
  25. }
  26. }
  27. - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  28. self.handlingTouch = NO;
  29. [self touch:touches];
  30. }
  31. - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  32. [self touch:touches];
  33. }
  34. - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  35. [self touch:touches];
  36. }
  37. - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  38. [self touch:touches];
  39. }
  40. @end