UILabel+Rx.swift 379 B

123456789101112131415161718192021
  1. //
  2. // UILabel+Rx.swift
  3. // SwiftBilibili
  4. //
  5. // Created by 罗文 on 2021/3/6.
  6. // Copyright © 2021年 罗文. All rights reserved.
  7. //
  8. import UIKit
  9. import RxCocoa
  10. import RxSwift
  11. extension Reactive where Base: UILabel {
  12. var textColor: Binder<UIColor?> {
  13. return Binder(self.base) { view,color in
  14. view.textColor = color ?? .clear
  15. }
  16. }
  17. }