ElePicView.m 907 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // ElePicView.m
  3. // JSJPCoach
  4. //
  5. // Created by EchoShacolee on 2018/1/31.
  6. // Copyright © 2018年 Danson. All rights reserved.
  7. //
  8. #import "ElePicView.h"
  9. @implementation ElePicView
  10. -(void)awakeFromNib{
  11. [super awakeFromNib];
  12. self.layer.shadowOffset = CGSizeMake(3, 3);
  13. self.layer.shadowColor = [UIColor grayColor].CGColor;
  14. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapClick)];
  15. [self.imgV addGestureRecognizer:tap];
  16. self.imgV.userInteractionEnabled = YES;
  17. self.imgV.contentMode = UIViewContentModeScaleAspectFit;
  18. }
  19. -(void)tapClick{
  20. if (self.clickBlock) {
  21. self.clickBlock(self.imgV.image);
  22. }
  23. }
  24. /*
  25. // Only override drawRect: if you perform custom drawing.
  26. // An empty implementation adversely affects performance during animation.
  27. - (void)drawRect:(CGRect)rect {
  28. // Drawing code
  29. }
  30. */
  31. @end