天天省钱快报

WLSubView.m 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // WLSubView.m
  3. // WLScrollView
  4. //
  5. // Created by 张子豪 on 2017/11/16.
  6. // Copyright © 2017年 张子豪. All rights reserved.
  7. //
  8. #import "WLSubView.h"
  9. @interface WLSubView ()
  10. {
  11. CGPoint isPoint;
  12. }
  13. @end
  14. @implementation WLSubView
  15. - (instancetype)initWithFrame:(CGRect)frame Identifier:(NSString *)indentifier{
  16. self = [super initWithFrame:frame];
  17. if (self) {
  18. self.identifier = indentifier;
  19. [self createUI];
  20. }
  21. return self;
  22. }
  23. #pragma mark - 重写
  24. - (void)createUI{
  25. UIImageView *imgView = [[UIImageView alloc] initWithFrame:self.bounds];
  26. }
  27. #pragma mark - touchesDelegate
  28. - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
  29. UITouch *touch = [touches anyObject];
  30. isPoint = [touch locationInView:self];
  31. }
  32. - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
  33. UITouch *touch = [touches anyObject];
  34. CGPoint Point = [touch locationInView:self];
  35. if (Point.x == isPoint.x && Point.y == isPoint.y
  36. && self.delegate
  37. && [self.delegate respondsToSelector:@selector(didSelectedRespond)]) {
  38. [self.delegate didSelectedRespond];
  39. }
  40. }
  41. @end