BGRoomSetPwdCell.m 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // BGRoomSetPwdCell.m
  3. // UniversalApp
  4. //
  5. // Created by bugu on 2020/3/23.
  6. // Copyright © 2020 voidcat. All rights reserved.
  7. //
  8. #import "BGRoomSetPwdCell.h"
  9. @interface BGRoomSetPwdCell ()
  10. @end
  11. @implementation BGRoomSetPwdCell
  12. - (void)awakeFromNib {
  13. [super awakeFromNib];
  14. // Initialization code
  15. }
  16. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  17. [super setSelected:selected animated:animated];
  18. // Configure the view for the selected state
  19. }
  20. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  21. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  22. [self initUI];
  23. }
  24. return self;
  25. }
  26. - (void)initUI {
  27. self.backgroundColor = [UIColor clearColor];
  28. self.contentView.backgroundColor = [UIColor clearColor];
  29. _passwordView = [RoomPasswordView getView];
  30. [_passwordView.txtPassword addTarget:self action:@selector(pwChange:) forControlEvents:UIControlEventEditingChanged];
  31. [self addSubview:_passwordView];
  32. [_passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.left.equalTo(self);
  34. make.right.equalTo(self);
  35. make.centerY.equalTo(self).offset(0);
  36. make.height.equalTo(@40);
  37. }];
  38. }
  39. - (void)pwChange:(UITextField *)textField {
  40. if (_pwdTextChangeBlock) {
  41. _pwdTextChangeBlock(textField.text);
  42. }
  43. }
  44. - (void)layoutSubviews {
  45. [super layoutSubviews];
  46. }
  47. @end