RAEditPhotoCell.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // RAEditPhotoCell.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/4.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RAEditPhotoCell.h"
  9. #import "RAEditPhotoModel.h"
  10. @interface RAEditPhotoCell ()
  11. @property (strong, nonatomic) IBOutlet UILabel *titleLabel;
  12. @property (strong, nonatomic) IBOutlet UIImageView *photoView;
  13. @end
  14. @implementation RAEditPhotoCell
  15. - (void)awakeFromNib {
  16. [super awakeFromNib];
  17. // Initialization code
  18. self.model = nil;
  19. self.photoView.layer.borderWidth = 0.5f;
  20. self.photoView.layer.borderColor = [UIColor lightGrayColor].CGColor;
  21. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(photoViewTap:)];
  22. [self.photoView addGestureRecognizer:tap];
  23. }
  24. - (void)prepareForReuse {
  25. [super prepareForReuse];
  26. self.model = nil;
  27. }
  28. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  29. [super setSelected:selected animated:animated];
  30. // Configure the view for the selected state
  31. }
  32. - (void)setModel:(RAEditPhotoModel *)model {
  33. _model = model;
  34. self.titleLabel.text = _model.title;
  35. self.photoView.image = _model.photo;
  36. }
  37. - (void)photoViewTap:(UITapGestureRecognizer *)sender {
  38. if (self.model.photo) {
  39. } else {
  40. }
  41. }
  42. @end