1234567891011121314151617181920212223242526272829303132 |
- //
- // UIView+Rx.swift
- // SwiftBilibili
- //
- // Created by 罗文 on 2021/2/1.
- // Copyright © 2021年 罗文. All rights reserved.
- //
- import UIKit
- import RxCocoa
- import RxSwift
- extension Reactive where Base: UIView {
- var setNeedsLayout: Binder<Void> {
- return Binder(self.base) { view, _ in
- view.setNeedsLayout()
- }
- }
-
- var backgroundColor: Binder<UIColor?> {
- return Binder(self.base) { view,color in
- view.backgroundColor = color
- }
- }
-
- var borderColor: Binder<UIColor?> {
- return Binder(self.base) { view,color in
- view.borderColor = color ?? .clear
- }
- }
- }
|