RQPhoneView.m 791 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // RQPhoneView.m
  3. // YueXueChe
  4. //
  5. // Created by 张嵘 on 2018/12/14.
  6. // Copyright © 2018 lee. All rights reserved.
  7. //
  8. #import "RQPhoneView.h"
  9. @interface RQPhoneView ()
  10. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *iconImageViewToSelf;
  11. @end
  12. @implementation RQPhoneView
  13. + (instancetype)loginCodeView {
  14. return [super rq_viewFromXib];
  15. }
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. @weakify(self)
  19. self.iconImageViewToSelf.constant = 6.f;
  20. [[[RACSignal merge:@[RACObserve(self.loginCodeTextField, text), self.loginCodeTextField.rac_textSignal]] skip:0] subscribeNext:^(NSString *text) {
  21. @strongify(self)
  22. if ([text containsString:@"-"]) {
  23. self.loginCodeTextField.text = [text stringByReplacingOccurrencesOfString:@"-" withString:@""];
  24. }
  25. }];
  26. }
  27. @end