JLMyFacePackgeCell.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // JLMyFacePackgeCell.m
  3. // shiku_im
  4. //
  5. // Created by JayLuo on 2019/12/12.
  6. // Copyright © 2019 Reese. All rights reserved.
  7. //
  8. #import "JLMyFacePackgeCell.h"
  9. @interface JLMyFacePackgeCell()
  10. @property (weak, nonatomic) IBOutlet UIButton *button;
  11. @property (weak, nonatomic) IBOutlet UIImageView *imageView;
  12. @property (weak, nonatomic) IBOutlet UILabel *label;
  13. @end
  14. @implementation JLMyFacePackgeCell
  15. - (void)awakeFromNib {
  16. [super awakeFromNib];
  17. // Initialization code
  18. _button.layer.cornerRadius = 5;
  19. _button.layer.masksToBounds = YES;
  20. _imageView.layer.cornerRadius = 5;
  21. _imageView.layer.masksToBounds = YES;
  22. }
  23. - (void)setModel:(JLFacePackgeModel *)model {
  24. _model = model;
  25. NSString *path = model.path? model.path: model.url;
  26. [_imageView sd_setImageWithURL:[NSURL URLWithString:path]];
  27. _label.text = model.faceName;
  28. }
  29. - (void)setJLMyFacePackgeCellDeleteCallBack:(void (^)(NSString * _Nonnull))JLMyFacePackgeCellDeleteCallBack {
  30. _JLMyFacePackgeCellDeleteCallBack = JLMyFacePackgeCellDeleteCallBack;
  31. }
  32. - (IBAction)deleteEmoji:(UIButton *)sender {
  33. if (_JLMyFacePackgeCellDeleteCallBack) {
  34. _JLMyFacePackgeCellDeleteCallBack(_model.faceName);
  35. }
  36. }
  37. @end