Skip to content

Commit 8c10f60

Browse files
authored
Merge pull request #574 from lechristian/cle/reactive-swift-6
Update ReactiveSwift to 6.0.0 We chatted, and requiring Swift 5 seems okay. Thanks again for the contribution!
2 parents 6021294 + 03df53c commit 8c10f60

20 files changed

+37
-53
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let package = Package(
1111
targets: ["Workflow"]),
1212
],
1313
dependencies: [
14-
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "5.0.0")
14+
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "6.0.0")
1515
],
1616
targets: [
1717
.target(

Workflow.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
1515

1616
s.source_files = 'swift/Workflow/Sources/*.swift'
1717

18-
s.dependency 'ReactiveSwift', '~> 5.0.0'
18+
s.dependency 'ReactiveSwift', '~> 6.0.0'
1919

2020
s.test_spec 'Tests' do |test_spec|
2121
test_spec.source_files = 'swift/Workflow/Tests/**/*.swift'

WorkflowTesting.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
1515

1616
s.source_files = 'swift/WorkflowTesting/Sources/*.swift'
1717

18-
s.dependency 'ReactiveSwift', '~> 5.0.0'
18+
s.dependency 'ReactiveSwift', '~> 6.0.0'
1919
s.dependency 'Workflow', "#{s.version}"
2020
s.framework = 'XCTest'
2121

docs/tutorial/adding-workflow-to-a-project.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ You'll need the following four libraries:
1010
import Workflow
1111
import WorkflowUI
1212
import ReactiveSwift
13-
import Result
1413
```
1514

1615
The easiest way to integrate these libraries is via Cocoapods. If you are using Cocoapods, you can
@@ -24,7 +23,6 @@ Pod::Spec.new do |s|
2423
s.dependency 'Workflow'
2524
s.dependency 'WorkflowUI'
2625
s.dependency 'ReactiveSwift'
27-
s.dependency 'Result'
2826

2927
# ...
3028
end

docs/tutorial/building-a-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ struct RefreshWorker: Worker {
187187
case error(Error)
188188
}
189189

190-
func run() -> SignalProducer<RefreshWorker.Output, NoError> {
190+
func run() -> SignalProducer<RefreshWorker.Output, Never> {
191191
return SignalProducer(value: .success("We did it!"))
192192
.delay(1.0, on: QueueScheduler.main)
193193
}

docs/tutorial/using-a-workflow-for-ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Workflows and the UI that is ultimately displayed. On iOS, the container is impl
1212
public final class ContainerViewController<Output, ScreenType>: UIViewController where ScreenType: Screen {
1313

1414
/// Emits output events from the bound workflow.
15-
public let output: Signal<Output, NoError>
15+
public let output: Signal<Output, Never>
1616

1717
public convenience init<W: Workflow>(workflow: W, viewRegistry: ViewRegistry) where W.Rendering == ScreenType, W.Output == Output
1818
}

swift/Samples/SampleApp/Sources/DemoWorkflow.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import Workflow
1717
import WorkflowUI
1818
import ReactiveSwift
19-
import Result
2019

2120

2221
// MARK: Input and Output
@@ -126,7 +125,7 @@ struct RefreshWorker: Worker {
126125
case error(Error)
127126
}
128127

129-
func run() -> SignalProducer<RefreshWorker.Output, NoError> {
128+
func run() -> SignalProducer<RefreshWorker.Output, Never> {
130129
return SignalProducer(value: .success("We did it!"))
131130
.delay(1.0, on: QueueScheduler.main)
132131
}
@@ -215,12 +214,12 @@ extension DemoWorkflow {
215214

216215

217216
fileprivate class TimerSignal {
218-
let signal: Signal<Void, NoError>
219-
let observer: Signal<Void, NoError>.Observer
217+
let signal: Signal<Void, Never>
218+
let observer: Signal<Void, Never>.Observer
220219
let timer: Timer
221220

222221
init() {
223-
let (signal, observer) = Signal<Void, NoError>.pipe()
222+
let (signal, observer) = Signal<Void, Never>.pipe()
224223

225224
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { [weak observer] _ in
226225
observer?.send(value: ())

swift/Tooling/Templates/Workflow (Verbose).xctemplate/___FILEBASENAME___Workflow.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import Workflow
44
import WorkflowUI
55
import ReactiveSwift
6-
import Result
76

87

98
// MARK: Input and Output
@@ -63,7 +62,7 @@ extension ___VARIABLE_productName___Workflow {
6362

6463
}
6564

66-
func run() -> SignalProducer<Output, NoError> {
65+
func run() -> SignalProducer<Output, Never> {
6766
fatalError()
6867
}
6968

swift/Workflow/Sources/RenderContext.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
import ReactiveSwift
17-
import Result
1817

1918
/// `RenderContext` is the composition point for the workflow tree.
2019
///
@@ -72,7 +71,7 @@ public class RenderContext<WorkflowType: Workflow>: RenderContextType {
7271
fatalError()
7372
}
7473

75-
public func subscribe<Action>(signal: Signal<Action, NoError>) where Action : WorkflowAction, WorkflowType == Action.WorkflowType {
74+
public func subscribe<Action>(signal: Signal<Action, Never>) where Action : WorkflowAction, WorkflowType == Action.WorkflowType {
7675
fatalError()
7776
}
7877

@@ -109,7 +108,7 @@ public class RenderContext<WorkflowType: Workflow>: RenderContextType {
109108
return implementation.makeSink(of: actionType)
110109
}
111110

112-
override func subscribe<Action>(signal: Signal<Action, NoError>) where WorkflowType == Action.WorkflowType, Action : WorkflowAction {
111+
override func subscribe<Action>(signal: Signal<Action, Never>) where WorkflowType == Action.WorkflowType, Action : WorkflowAction {
113112
assertStillValid()
114113
return implementation.subscribe(signal: signal)
115114
}
@@ -136,7 +135,7 @@ internal protocol RenderContextType: class {
136135

137136
func makeSink<Action>(of actionType: Action.Type) -> Sink<Action> where Action: WorkflowAction, Action.WorkflowType == WorkflowType
138137

139-
func subscribe<Action>(signal: Signal<Action, NoError>) where Action: WorkflowAction, Action.WorkflowType == WorkflowType
138+
func subscribe<Action>(signal: Signal<Action, Never>) where Action: WorkflowAction, Action.WorkflowType == WorkflowType
140139

141140
func awaitResult<W, Action>(for worker: W, outputMap: @escaping (W.Output) -> Action) where W: Worker, Action: WorkflowAction, Action.WorkflowType == WorkflowType
142141

swift/Workflow/Sources/SubtreeManager.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
import Dispatch
1717
import ReactiveSwift
18-
import Result
1918

2019
extension WorkflowNode {
2120

@@ -159,7 +158,7 @@ extension WorkflowNode.SubtreeManager {
159158
private let originalChildWorkers: [AnyChildWorker]
160159
private (set) internal var usedChildWorkers: [AnyChildWorker]
161160

162-
private (set) internal var eventSources: [Signal<AnyWorkflowAction<WorkflowType>, NoError>] = []
161+
private (set) internal var eventSources: [Signal<AnyWorkflowAction<WorkflowType>, Never>] = []
163162

164163
internal init(previousSinks: [ObjectIdentifier:AnyReusableSink], originalChildWorkflows: [ChildKey:AnyChildWorkflow], originalChildWorkers: [AnyChildWorker]) {
165164
self.eventPipes = []
@@ -229,7 +228,7 @@ extension WorkflowNode.SubtreeManager {
229228
return sink
230229
}
231230

232-
func subscribe<Action>(signal: Signal<Action, NoError>) where Action : WorkflowAction, WorkflowType == Action.WorkflowType {
231+
func subscribe<Action>(signal: Signal<Action, Never>) where Action : WorkflowAction, WorkflowType == Action.WorkflowType {
233232
eventSources.append(signal.map { AnyWorkflowAction($0) })
234233
}
235234

@@ -434,7 +433,7 @@ extension WorkflowNode.SubtreeManager {
434433

435434
let worker: W
436435

437-
let signalProducer: SignalProducer<W.Output, NoError>
436+
let signalProducer: SignalProducer<W.Output, Never>
438437

439438
private var outputMap: (W.Output) -> AnyWorkflowAction<WorkflowType>
440439

@@ -478,7 +477,7 @@ extension WorkflowNode.SubtreeManager {
478477
private var (lifetime, token) = Lifetime.make()
479478
private (set) internal var eventPipe: EventPipe
480479

481-
init(eventSources: [Signal<AnyWorkflowAction<WorkflowType>, NoError>], eventPipe: EventPipe) {
480+
init(eventSources: [Signal<AnyWorkflowAction<WorkflowType>, Never>], eventPipe: EventPipe) {
482481
self.eventPipe = eventPipe
483482

484483
Signal

swift/Workflow/Sources/Worker.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
import ReactiveSwift
17-
import Result
1817

1918
/// Workers define a unit of asynchronous work.
2019
///
@@ -30,7 +29,7 @@ public protocol Worker {
3029
associatedtype Output
3130

3231
/// Returns a signal producer to execute the work represented by this worker.
33-
func run() -> SignalProducer<Output, NoError>
32+
func run() -> SignalProducer<Output, Never>
3433

3534
/// Returns `true` if the other worker should be considered equivalent to `self`. Equivalence should take into
3635
/// account whatever data is meaninful to the task. For example, a worker that loads a user account from a server

swift/Workflow/Sources/WorkflowHost.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
import ReactiveSwift
17-
import Result
1817

1918
/// Defines a type that receives debug information about a running workflow hierarchy.
2019
public protocol WorkflowDebugger {
@@ -36,7 +35,7 @@ public final class WorkflowHost<WorkflowType: Workflow> {
3635

3736
private let debugger: WorkflowDebugger?
3837

39-
private let (outputEvent, outputEventObserver) = Signal<WorkflowType.Output, NoError>.pipe()
38+
private let (outputEvent, outputEventObserver) = Signal<WorkflowType.Output, Never>.pipe()
4039

4140
private let rootNode: WorkflowNode<WorkflowType>
4241

@@ -96,7 +95,7 @@ public final class WorkflowHost<WorkflowType: Workflow> {
9695
}
9796

9897
/// A signal containing output events emitted by the root workflow in the hierarchy.
99-
public var output: Signal<WorkflowType.Output, NoError> {
98+
public var output: Signal<WorkflowType.Output, Never> {
10099
return outputEvent
101100
}
102101

swift/Workflow/Tests/AnyWorkflowTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import XCTest
1717
@testable import Workflow
1818
import ReactiveSwift
19-
import Result
2019

2120
public class AnyWorkflowTests: XCTestCase {
2221

swift/Workflow/Tests/ConcurrencyTests.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import XCTest
1717
@testable import Workflow
1818

1919
import ReactiveSwift
20-
import Result
2120

2221

2322
final class ConcurrencyTests: XCTestCase {
@@ -483,7 +482,7 @@ final class ConcurrencyTests: XCTestCase {
483482
struct DelayWorker: Worker {
484483
typealias Output = Action
485484

486-
func run() -> SignalProducer<Output, NoError> {
485+
func run() -> SignalProducer<Output, Never> {
487486
return SignalProducer(value: .update).delay(0.1, on: QueueScheduler.main)
488487
}
489488

@@ -516,7 +515,7 @@ final class ConcurrencyTests: XCTestCase {
516515
// MARK - Test Types
517516

518517
fileprivate class TestSignal {
519-
let (signal, observer) = Signal<Int, NoError>.pipe()
518+
let (signal, observer) = Signal<Int, Never>.pipe()
520519
var sent: Bool = false
521520

522521
func send(value: Int) {
@@ -610,7 +609,7 @@ final class ConcurrencyTests: XCTestCase {
610609
struct TestWorker: Worker {
611610
typealias Output = TestWorkflow.Action
612611

613-
func run() -> SignalProducer<Output, NoError> {
612+
func run() -> SignalProducer<Output, Never> {
614613
return SignalProducer(value: .update)
615614
}
616615

swift/Workflow/Tests/SubtreeManagerTests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import XCTest
1717
@testable import Workflow
1818
import ReactiveSwift
19-
import Result
2019

2120

2221
final class SubtreeManagerTests: XCTestCase {
@@ -182,8 +181,8 @@ final class SubtreeManagerTests: XCTestCase {
182181

183182
typealias Output = Void
184183

185-
func run() -> SignalProducer<Void, NoError> {
186-
return SignalProducer<Void, NoError>({ [weak startExpectation, weak endExpectation] (observer, lifetime) in
184+
func run() -> SignalProducer<Void, Never> {
185+
return SignalProducer<Void, Never>({ [weak startExpectation, weak endExpectation] (observer, lifetime) in
187186
lifetime.observeEnded {
188187
endExpectation?.fulfill()
189188
}
@@ -229,7 +228,7 @@ final class SubtreeManagerTests: XCTestCase {
229228

230229
func test_subscriptionsUnsubscribe() {
231230
struct SubscribingWorkflow: Workflow {
232-
var signal: Signal<Void, NoError>?
231+
var signal: Signal<Void, Never>?
233232

234233
struct State {}
235234

@@ -261,7 +260,7 @@ final class SubtreeManagerTests: XCTestCase {
261260
emittedExpectation.fulfill()
262261
}
263262

264-
let (signal, observer) = Signal<Void, NoError>.pipe()
263+
let (signal, observer) = Signal<Void, Never>.pipe()
265264

266265
let isSubscribing = manager.render { context -> Bool in
267266
SubscribingWorkflow(

swift/Workflow/Tests/WorkflowNodeTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import XCTest
1717
@testable import Workflow
1818

1919
import ReactiveSwift
20-
import Result
2120

2221

2322
final class WorkflowNodeTests: XCTestCase {
@@ -227,7 +226,7 @@ final class WorkflowNodeTests: XCTestCase {
227226
return true
228227
}
229228

230-
func run() -> SignalProducer<Int, NoError> {
229+
func run() -> SignalProducer<Int, Never> {
231230
return SignalProducer{ observer, lifetime in
232231
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: {
233232
observer.send(value: 1)

swift/WorkflowTesting/Sources/WorkflowRenderTester.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
import XCTest
1717
import ReactiveSwift
18-
import Result
1918
@testable import Workflow
2019

2120

@@ -260,15 +259,15 @@ fileprivate final class RenderTestContext<T: Workflow>: RenderContextType {
260259
}
261260

262261
func makeSink<Action>(of actionType: Action.Type) -> Sink<Action> where Action : WorkflowAction, T == Action.WorkflowType {
263-
let (signal, observer) = Signal<AnyWorkflowAction<WorkflowType>, NoError>.pipe()
262+
let (signal, observer) = Signal<AnyWorkflowAction<WorkflowType>, Never>.pipe()
264263
let sink = Sink<Action> { action in
265264
observer.send(value: AnyWorkflowAction(action))
266265
}
267266
subscribe(signal: signal)
268267
return sink
269268
}
270269

271-
func subscribe<Action>(signal: Signal<Action, NoError>) where Action : WorkflowAction, RenderTestContext<T>.WorkflowType == Action.WorkflowType {
270+
func subscribe<Action>(signal: Signal<Action, Never>) where Action : WorkflowAction, RenderTestContext<T>.WorkflowType == Action.WorkflowType {
272271
signal
273272
.take(during: lifetime)
274273
.observeValues { [weak self] action in

swift/WorkflowTesting/Tests/WorkflowRenderTesterTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
import XCTest
1717
import ReactiveSwift
18-
import Result
1918
import Workflow
2019
import WorkflowTesting
2120

@@ -294,7 +293,7 @@ fileprivate struct TestWorker: Worker {
294293
case failure
295294
}
296295

297-
func run() -> SignalProducer<Output, NoError> {
296+
func run() -> SignalProducer<Output, Never> {
298297
return SignalProducer(value: .success)
299298
}
300299

swift/WorkflowUI/Sources/Container/ContainerViewController.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
*/
1616
import UIKit
1717
import ReactiveSwift
18-
import Result
1918
import Workflow
2019

2120

2221
/// Drives view controllers from a root Workflow.
2322
public final class ContainerViewController<Output, ScreenType>: UIViewController where ScreenType: Screen {
2423

2524
/// Emits output events from the bound workflow.
26-
public let output: Signal<Output, NoError>
25+
public let output: Signal<Output, Never>
2726

2827
internal let rootViewController: ScreenViewController<ScreenType>
2928

@@ -33,7 +32,7 @@ public final class ContainerViewController<Output, ScreenType>: UIViewController
3332

3433
private let (lifetime, token) = Lifetime.make()
3534

36-
private init(workflowHost: Any, rendering: Property<ScreenType>, output: Signal<Output, NoError>, viewRegistry: ViewRegistry) {
35+
private init(workflowHost: Any, rendering: Property<ScreenType>, output: Signal<Output, Never>, viewRegistry: ViewRegistry) {
3736
self.workflowHost = workflowHost
3837
self.rootViewController = viewRegistry.provideView(for: rendering.value)
3938
self.rendering = rendering

0 commit comments

Comments
 (0)