Skip to content

Commit

Permalink
Remove redundant property binders and KeyPathBinder
Browse files Browse the repository at this point in the history
  • Loading branch information
freak4pc committed Oct 6, 2020
1 parent 4cf13fb commit 601d334
Show file tree
Hide file tree
Showing 38 changed files with 10 additions and 564 deletions.
10 changes: 0 additions & 10 deletions .jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ custom_categories:
- ControlTarget
- DelegateProxy
- DelegateProxyType
- KeyPathBinder
- NSLayoutConstraint+Rx
- Observable+Bind
- RxCocoaObjCRuntimeError+Extensions
- RxTarget
Expand Down Expand Up @@ -68,21 +66,15 @@ custom_categories:
children:
- NSTextStorage+Rx
- UIActivityIndicatorView+Rx
- UIAlertAction+Rx
- UIApplication+Rx
- UIBarButtonItem+Rx
- UIButton+Rx
- UICollectionView+Rx
- UIControl+Rx
- UIDatePicker+Rx
- UIGestureRecognizer+Rx
- UIImageView+Rx
- UILabel+Rx
- UINavigationController+Rx
- UINavigationItem+Rx
- UIPageControl+Rx
- UIPickerView+Rx
- UIProgressView+Rx
- UIRefreshControl+Rx
- UIScrollView+Rx
- UISearchBar+Rx
Expand All @@ -93,7 +85,6 @@ custom_categories:
- UISwitch+Rx
- UITabBar+Rx
- UITabBarController+Rx
- UITabBarItem+Rx
- UITableView+Rx
- UITextField+Rx
- UITextView+Rx
Expand Down Expand Up @@ -128,7 +119,6 @@ custom_categories:
children:
- NSButton+Rx
- NSControl+Rx
- NSImageView+Rx
- NSSlider+Rx
- NSTextField+Rx
- NSTextView+Rx
Expand Down
65 changes: 5 additions & 60 deletions Rx.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

34 changes: 0 additions & 34 deletions RxCocoa/Common/KeyPathBinder.swift

This file was deleted.

39 changes: 0 additions & 39 deletions RxCocoa/Common/NSLayoutConstraint+Rx.swift

This file was deleted.

2 changes: 0 additions & 2 deletions RxCocoa/iOS/UIActivityIndicatorView+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import UIKit
import RxSwift

extension Reactive where Base: UIActivityIndicatorView {

/// Bindable sink for `startAnimating()`, `stopAnimating()` methods.
public var isAnimating: Binder<Bool> {
return Binder(self.base) { activityIndicator, active in
Expand All @@ -23,7 +22,6 @@ extension Reactive where Base: UIActivityIndicatorView {
}
}
}

}

#endif
25 changes: 0 additions & 25 deletions RxCocoa/iOS/UIAlertAction+Rx.swift

This file was deleted.

15 changes: 0 additions & 15 deletions RxCocoa/iOS/UIBarButtonItem+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ import RxSwift
private var rx_tap_key: UInt8 = 0

extension Reactive where Base: UIBarButtonItem {

/// Bindable sink for `enabled` property.
public var isEnabled: Binder<Bool> {
return Binder(self.base) { element, value in
element.isEnabled = value
}
}

/// Bindable sink for `title` property.
public var title: Binder<String> {
return Binder(self.base) { element, value in
element.title = value
}
}

/// Reactive wrapper for target action pattern on `self`.
public var tap: ControlEvent<()> {
let source = lazyInstanceObservable(&rx_tap_key) { () -> Observable<()> in
Expand Down
3 changes: 0 additions & 3 deletions RxCocoa/iOS/UIButton+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import RxSwift
import UIKit

extension Reactive where Base: UIButton {

/// Reactive wrapper for `setTitle(_:for:)`
public func title(for controlState: UIControl.State = []) -> Binder<String?> {
return Binder(self.base) { button, title -> Void in
Expand Down Expand Up @@ -74,13 +73,11 @@ extension Reactive where Base: UIButton {
import UIKit

extension Reactive where Base: UIButton {

/// Reactive wrapper for `setAttributedTitle(_:controlState:)`
public func attributedTitle(for controlState: UIControl.State = []) -> Binder<NSAttributedString?> {
return Binder(self.base) { button, attributedTitle -> Void in
button.setAttributedTitle(attributedTitle, for: controlState)
}
}

}
#endif
22 changes: 0 additions & 22 deletions RxCocoa/iOS/UIControl+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,6 @@ import RxSwift
import UIKit

extension Reactive where Base: UIControl {

/// Bindable sink for `enabled` property.
public var isEnabled: Binder<Bool> {
return Binder(self.base) { control, value in
control.isEnabled = value
}
}

/// Bindable sink for `selected` property.
public var isSelected: Binder<Bool> {
return Binder(self.base) { control, selected in
control.isSelected = selected
}
}

/// Bindable sink for `highlighted` property.
public var isHighlighted: Binder<Bool> {
return Binder(self.base) { control, highlighted in
control.isHighlighted = highlighted
}
}

/// Reactive wrapper for target action pattern.
///
/// - parameter controlEvents: Filter for observed event types.
Expand Down
24 changes: 0 additions & 24 deletions RxCocoa/iOS/UIImageView+Rx.swift

This file was deleted.

32 changes: 0 additions & 32 deletions RxCocoa/iOS/UILabel+Rx.swift

This file was deleted.

32 changes: 0 additions & 32 deletions RxCocoa/iOS/UIPageControl+Rx.swift

This file was deleted.

25 changes: 0 additions & 25 deletions RxCocoa/iOS/UIProgressView+Rx.swift

This file was deleted.

7 changes: 0 additions & 7 deletions RxCocoa/iOS/UIScrollView+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@
return ControlProperty(values: proxy.contentOffsetBehaviorSubject, valueSink: bindingObserver)
}

/// Bindable sink for `scrollEnabled` property.
public var isScrollEnabled: Binder<Bool> {
return Binder(self.base) { scrollView, scrollEnabled in
scrollView.isScrollEnabled = scrollEnabled
}
}

/// Reactive wrapper for delegate method `scrollViewDidScroll`
public var didScroll: ControlEvent<Void> {
let source = RxScrollViewDelegateProxy.proxy(for: base).contentOffsetPublishSubject
Expand Down
4 changes: 2 additions & 2 deletions RxCocoa/iOS/UISearchBar+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ extension Reactive where Base: UISearchBar {
.map { _ in searchBar?.text ?? "" }
.startWith(text)
}

let bindingObserver = Binder(self.base) { (searchBar, text: String?) in
searchBar.text = text
}

return ControlProperty(values: source, valueSink: bindingObserver)
}

Expand Down
8 changes: 0 additions & 8 deletions RxCocoa/iOS/UIStepper+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ extension Reactive where Base: UIStepper {
}
)
}

/// Reactive wrapper for `stepValue` property.
public var stepValue: Binder<Double> {
return Binder(self.base) { stepper, value in
stepper.stepValue = value
}
}

}

#endif
Expand Down
Loading

0 comments on commit 601d334

Please sign in to comment.