Skip to content

Commit 0c71f19

Browse files
committed
Code changes for Swift 4
1 parent 55f3558 commit 0c71f19

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Sources/Action/Action.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public final class Action<Input, Element> {
6666
errors = errorsSubject.asObservable()
6767

6868
executionObservables = inputs
69-
.withLatestFrom(enabled) { $0 }
69+
.withLatestFrom(enabled) { input, enabled in (input, enabled) }
7070
.flatMap { input, enabled -> Observable<Observable<Element>> in
7171
if enabled {
7272
return Observable.of(workFactory(input)

Sources/Action/UIKitExtensions/UIAlertAction+Action.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public extension UIAlertAction {
77

88
public static func Action(_ title: String?, style: UIAlertActionStyle) -> UIAlertAction {
99
return UIAlertAction(title: title, style: style, handler: { action in
10-
action.rx.action?.execute()
10+
action.rx.action?.execute(())
1111
return
1212
})
1313
}

Sources/Action/UIKitExtensions/UIBarButtonItem+Action.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public extension Reactive where Base: UIBarButtonItem {
3030
.bind(to: self.isEnabled)
3131
.disposed(by: self.base.actionDisposeBag)
3232

33-
self.tap.subscribe(onNext: { (_) in
34-
action.execute()
33+
self.tap.subscribe(onNext: {
34+
action.execute(())
3535
})
3636
.disposed(by: self.base.actionDisposeBag)
3737
}

Tests/iOS-Tests/AlertActionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class AlertActionTests: QuickSpec {
3434

3535
subject.rx.action = action
3636

37-
action.execute()
37+
action.execute(())
3838
expect(subject.isEnabled).toEventually( beFalse() )
3939

4040
observer.onCompleted()

Tests/iOS-Tests/BarButtonTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class BarButtonTests: QuickSpec {
3535

3636
subject.rx.action = action
3737

38-
action.execute()
38+
action.execute(())
3939
expect(subject.isEnabled).toEventually( beFalse() )
4040

4141
observer.onCompleted()

Tests/iOS-Tests/ButtonTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ButtonTests: QuickSpec {
3535

3636
subject.rx.action = action
3737

38-
action.execute()
38+
action.execute(())
3939
expect(subject.isEnabled).toEventually( beFalse() )
4040

4141
observer.onCompleted()
@@ -123,7 +123,7 @@ class ButtonTests: QuickSpec {
123123
}
124124

125125
subject.rx.action = action
126-
subject.rx.action?.execute()
126+
subject.rx.action?.execute(())
127127
}
128128
}
129129

0 commit comments

Comments
 (0)