JXSearchRecordCell.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // JXSearchRecordCell.m
  3. // shiku_im
  4. //
  5. // Created by IMAC on 2019/9/6.
  6. // Copyright © 2019 Reese. All rights reserved.
  7. //
  8. #import "JXSearchRecordCell.h"
  9. @implementation JXSearchRecordCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. _deleteBtn = [[UIButton alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH - 32, 16.5, 17, 17)];
  14. [_deleteBtn setBackgroundImage:[UIImage imageNamed:@"delete_icon"] forState:UIControlStateNormal];
  15. _deleteBtn.layer.cornerRadius = 10;
  16. _deleteBtn.layer.masksToBounds = YES;
  17. [_deleteBtn addTarget:self action:@selector(deleteSelf) forControlEvents:UIControlEventTouchUpInside];
  18. [self.contentView addSubview:_deleteBtn];
  19. }
  20. return self;
  21. }
  22. - (void)deleteSelf{
  23. if ([self.delegate respondsToSelector:@selector(deleteCell:)]) {
  24. [self.delegate deleteCell:self];
  25. }
  26. }
  27. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  28. [super setSelected:selected animated:animated];
  29. // Configure the view for the selected state
  30. }
  31. @end