Skip to content

Commit e1b8547

Browse files
author
Tom Burns
committed
Require Rx 3.4.0, migrate bindTo() -> bind(to:)
1 parent 7c11e59 commit e1b8547

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

Action.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Action"
3-
s.version = "2.2.2"
3+
s.version = "3.0.0"
44
s.summary = "Abstracts actions to be performed in RxSwift."
55
s.description = <<-DESC
66
Encapsulates an action to be performed, usually by a UIButton press.
@@ -21,8 +21,8 @@ Pod::Spec.new do |s|
2121
s.source_files = "Sources/**/*.{swift}"
2222

2323
s.frameworks = "Foundation"
24-
s.dependency "RxSwift", "~> 3.0"
25-
s.dependency "RxCocoa", "~> 3.0"
24+
s.dependency "RxSwift", "~> 3.4.0"
25+
s.dependency "RxCocoa", "~> 3.4.0"
2626

2727
s.watchos.exclude_files = "UIButton+Rx.swift", "UIBarButtonItem+Action.swift", "AlertAction.swift"
2828
s.osx.exclude_files = "UIButton+Rx.swift", "UIBarButtonItem+Action.swift", "AlertAction.swift"

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "ReactiveX/RxSwift" ~> 3.3.0
1+
github "ReactiveX/RxSwift" ~> 3.4.0

Cartfile.resolved

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
github "Quick/Nimble" "v5.1.1"
2-
github "Quick/Quick" "v1.0.0"
3-
github "ReactiveX/RxSwift" "3.3.0"
1+
github "Quick/Nimble" "v6.1.0"
2+
github "Quick/Quick" "v1.1.0"
3+
github "ReactiveX/RxSwift" "3.4.0"

Carthage/Checkouts/Nimble

Submodule Nimble updated 101 files

Carthage/Checkouts/Quick

Submodule Quick updated 52 files

Carthage/Checkouts/RxSwift

Submodule RxSwift updated 152 files

Sources/Action/UIKitExtensions/UIBarButtonItem+Action.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public extension Reactive where Base: UIBarButtonItem {
3838
}
3939
}
4040

41-
public func bindTo<Input, Output>(action: Action<Input, Output>, inputTransform: @escaping (Base) -> (Input)) {
41+
public func bind<Input, Output>(to action: Action<Input, Output>, inputTransform: @escaping (Base) -> (Input)) {
4242
unbindAction()
4343

4444
self.tap
@@ -52,8 +52,8 @@ public extension Reactive where Base: UIBarButtonItem {
5252
.addDisposableTo(self.base.actionDisposeBag)
5353
}
5454

55-
public func bindTo<Input, Output>(action: Action<Input, Output>, input: Input) {
56-
self.bind(to: action: action) { _ in input}
55+
public func bind<Input, Output>(to action: Action<Input, Output>, input: Input) {
56+
self.bind(to: action) { _ in input}
5757
}
5858

5959
/// Unbinds any existing action, disposing of all subscriptions.

Sources/Action/UIKitExtensions/UIButton+Rx.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public extension Reactive where Base: UIButton {
5555
/// Binds enabled state of action to button, and subscribes to rx_tap to execute action with given input transform.
5656
/// These subscriptions are managed in a private, inaccessible dispose bag. To cancel
5757
/// them, call bindToAction with another action or call unbindAction().
58-
public func bindTo<Input, Output>(action:Action<Input, Output>, inputTransform: @escaping (Base) -> (Input)) {
58+
public func bind<Input, Output>(to action: Action<Input, Output>, inputTransform: @escaping (Base) -> (Input)) {
5959
// This effectively disposes of any existing subscriptions.
6060
unbindAction()
6161

@@ -72,14 +72,14 @@ public extension Reactive where Base: UIButton {
7272
guard let controlEvent = lookupControlEvent else {
7373
return
7474
}
75-
self.bind(to: action: action, controlEvent: controlEvent, inputTransform: inputTransform)
75+
self.bind(to: action, controlEvent: controlEvent, inputTransform: inputTransform)
7676
}
7777

7878
/// Binds enabled state of action to button, and subscribes to rx_tap to execute action with given input value.
7979
/// These subscriptions are managed in a private, inaccessible dispose bag. To cancel
8080
/// them, call bindToAction with another action or call unbindAction().
81-
public func bindTo<Input, Output>(action: Action<Input, Output>, input: Input) {
82-
self.bind(to: action: action) { _ in input }
81+
public func bind<Input, Output>(to action: Action<Input, Output>, input: Input) {
82+
self.bind(to: action) { _ in input }
8383
}
8484
}
8585
#endif

Sources/Action/UIKitExtensions/UIControl+Rx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public extension Reactive where Base: UIControl {
77
/// Binds enabled state of action to control, and subscribes action's execution to provided controlEvents.
88
/// These subscriptions are managed in a private, inaccessible dispose bag. To cancel
99
/// them, set the rx.action to nil or another action, or call unbindAction().
10-
public func bindTo<Input, Output>(action: Action<Input, Output>, controlEvent: ControlEvent<Void>, inputTransform: @escaping (Base) -> (Input)) {
10+
public func bind<Input, Output>(to action: Action<Input, Output>, controlEvent: ControlEvent<Void>, inputTransform: @escaping (Base) -> (Input)) {
1111
// This effectively disposes of any existing subscriptions.
1212
unbindAction()
1313

Tests/ActionTests/BindToTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class BindToTests: QuickSpec {
2626
called = true
2727
return .empty()
2828
})
29-
button.rx.bind(to: action: action, input: "Hi there!")
29+
button.rx.bind(to: action, input: "Hi there!")
3030
// Setting the action has an asynchronous effect of adding a target.
3131
expect(button.allTargets).toEventuallyNot( beEmpty() )
3232

@@ -42,7 +42,7 @@ class BindToTests: QuickSpec {
4242
called = true
4343
return .empty()
4444
})
45-
button.rx.bind(to: action: action, controlEvent: button.rx.tap, inputTransform: { input in "\(input)" })
45+
button.rx.bind(to: action, controlEvent: button.rx.tap, inputTransform: { input in "\(input)" })
4646
// Setting the action has an asynchronous effect of adding a target.
4747
expect(button.allTargets).toEventuallyNot( beEmpty() )
4848

@@ -58,7 +58,7 @@ class BindToTests: QuickSpec {
5858
called = true
5959
return .empty()
6060
})
61-
item.rx.bind(to: action: action, input: "Hi there!")
61+
item.rx.bind(to: action, input: "Hi there!")
6262

6363
_ = item.target!.perform(item.action!, with: item)
6464

@@ -72,7 +72,7 @@ class BindToTests: QuickSpec {
7272
assertionFailure()
7373
return .empty()
7474
})
75-
button.rx.bind(to: action: action, input: "Hi there!")
75+
button.rx.bind(to: action, input: "Hi there!")
7676
// Setting the action has an asynchronous effect of adding a target.
7777
expect(button.allTargets).toEventuallyNot( beEmpty() )
7878

@@ -89,7 +89,7 @@ class BindToTests: QuickSpec {
8989
called = true
9090
return .empty()
9191
})
92-
item.rx.bind(to: action: action, input: "Hi there!")
92+
item.rx.bind(to: action, input: "Hi there!")
9393

9494
item.rx.unbindAction()
9595
_ = item.target?.perform(item.action!, with: item)

0 commit comments

Comments
 (0)