diff --git a/Podfile.lock b/Podfile.lock index 97483dca0..ab9d19557 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -2,7 +2,7 @@ PODS: - CwlCatchException (1.0.2) - CwlPreconditionTesting (1.1.1): - CwlCatchException - - DynamicWorkflow (0.0.7) + - DynamicWorkflow (0.0.10) - UIUTest (1.6.0) DEPENDENCIES: @@ -36,7 +36,7 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: CwlCatchException: 70a52ae44ea5d46db7bd385f801a94942420cd8c CwlPreconditionTesting: d33a4e4f285c0b885fddcae5dfedfbb34d4f3961 - DynamicWorkflow: 214b6218b7e17dc458c865ea5f09436bf4922da5 + DynamicWorkflow: a977fca94a5318fb6c6fa95f4d041e8656a80446 UIUTest: 842c642e5bec098b1e2c890cbe25aacab80f2481 PODFILE CHECKSUM: 5f55f064de83e2e4f31f04427448900a8e9571f2 diff --git a/Workflow.xcodeproj/xcshareddata/xcschemes/Workflow.xcscheme b/Workflow.xcodeproj/xcshareddata/xcschemes/Workflow.xcscheme index e9f6ba985..12971ba43 100644 --- a/Workflow.xcodeproj/xcshareddata/xcschemes/Workflow.xcscheme +++ b/Workflow.xcodeproj/xcshareddata/xcschemes/Workflow.xcscheme @@ -26,8 +26,17 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - codeCoverageEnabled = "YES" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + @@ -39,18 +48,17 @@ ReferencedContainer = "container:Workflow.xcodeproj"> + + + + - - - - - - - - Void)? { get set } + var proceedInWorkflow:((Any?) -> Void)? { get set } mutating func erasedShouldLoad(with args:Any?) -> Bool diff --git a/Workflow/UIKitPresenter/UIWorkflowItem.swift b/Workflow/UIKitPresenter/UIWorkflowItem.swift index e5c523db2..db9122c9c 100644 --- a/Workflow/UIKitPresenter/UIWorkflowItem.swift +++ b/Workflow/UIKitPresenter/UIWorkflowItem.swift @@ -46,7 +46,7 @@ import UIKit */ open class UIWorkflowItem: UIViewController { - public var callback: ((Any?) -> Void)? + public var proceedInWorkflow: ((Any?) -> Void)? public typealias IntakeType = I diff --git a/Workflow/Workflow.swift b/Workflow/Workflow.swift index 95b793cac..ba62e562b 100644 --- a/Workflow/Workflow.swift +++ b/Workflow/Workflow.swift @@ -101,7 +101,7 @@ public class Workflow: LinkedList { } private func removeInstances() { - instances.forEach { $0.value?.callback = nil } + instances.forEach { $0.value?.proceedInWorkflow = nil } instances.removeAll() self.firstLoadedInstance = nil } @@ -111,21 +111,21 @@ public class Workflow: LinkedList { } private func setupCallbacks(for node:LinkedList.Node, onFinish:((Any?) -> Void)?) { - node.value?.callback = { args in + node.value?.proceedInWorkflow = { args in var argsToPass = args let nextNode = node.next?.traverse { let index = $0.position var instance = self.first?.traverse(index)?.value.instance() - instance?.callback = $0.value?.callback + instance?.proceedInWorkflow = $0.value?.proceedInWorkflow instance?.workflow = self - let hold = instance?.callback + let hold = instance?.proceedInWorkflow defer { - instance?.callback = hold + instance?.proceedInWorkflow = hold self.replaceInstance(atIndex: index, withInstance: instance) } - instance?.callback = { argsToPass = $0 } + instance?.proceedInWorkflow = { argsToPass = $0 } return instance?.erasedShouldLoad(with: argsToPass) == true } diff --git a/WorkflowExampleTests/EnterAddressViewControllerTests.swift b/WorkflowExampleTests/EnterAddressViewControllerTests.swift index 4b6ccee34..8610f2aa7 100644 --- a/WorkflowExampleTests/EnterAddressViewControllerTests.swift +++ b/WorkflowExampleTests/EnterAddressViewControllerTests.swift @@ -22,7 +22,7 @@ class EnterAddressViewControllerTests: ViewControllerTest { let rand = UUID().uuidString var callbackCalled = false loadFromStoryboard { viewController in - viewController.callback = { data in + viewController.proceedInWorkflow = { data in callbackCalled = true XCTAssert(data is Order, "View should pass on data as an order object") XCTAssertEqual((data as? Order)?.location?.name, rand, "The location in the order should be the same one selected") @@ -88,7 +88,7 @@ class LocationsViewControllerTests:ViewControllerTest { Location(name: rand, address: Address(line1: "", line2: "", city: "", state: "", zip: ""), orderTypes: [], menuTypes: []), Location(name: "", address: Address(line1: "", line2: "", city: "", state: "", zip: ""), orderTypes: [], menuTypes: []) ]) - viewController.callback = { data in + viewController.proceedInWorkflow = { data in callbackCalled = true XCTAssert(data is Order, "View should pass on data as an order object") XCTAssertEqual((data as? Order)?.location?.name, rand, "The location in the order should be the same one selected") diff --git a/WorkflowExampleTests/MenuSelectionViewControllerTests.swift b/WorkflowExampleTests/MenuSelectionViewControllerTests.swift index f9bb9ce1b..f4efd1a4b 100644 --- a/WorkflowExampleTests/MenuSelectionViewControllerTests.swift +++ b/WorkflowExampleTests/MenuSelectionViewControllerTests.swift @@ -24,7 +24,7 @@ class MenuSelectionViewControllerTests: ViewControllerTest Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = Void? @@ -52,7 +52,7 @@ class UIKitPresenterTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = String? @@ -73,7 +73,7 @@ class UIKitPresenterTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = Int? @@ -105,7 +105,7 @@ class UIKitPresenterTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = Void? @@ -141,7 +141,7 @@ class UIKitPresenterTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = Void? @@ -183,7 +183,7 @@ class UIKitPresenterTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = Void? @@ -226,7 +226,7 @@ class UIKitPresenterTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = Void? diff --git a/WorkflowTests/WorkflowTests.swift b/WorkflowTests/WorkflowTests.swift index 122badaeb..0361d91bc 100644 --- a/WorkflowTests/WorkflowTests.swift +++ b/WorkflowTests/WorkflowTests.swift @@ -21,7 +21,7 @@ class WorkflowTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? static var shouldLoadCalledOnFR1 = false typealias IntakeType = String @@ -44,7 +44,7 @@ class WorkflowTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? static var shouldLoadCalledOnFR2 = false typealias IntakeType = Int @@ -80,7 +80,7 @@ class WorkflowTests: XCTestCase { var workflow: Workflow? - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? static var shouldLoadCalledOnFR1 = false typealias IntakeType = Any? @@ -222,7 +222,7 @@ class WorkflowTests: XCTestCase { class TestFlowRepresentable { var preferredLaunchStyle: PresentationType = .default - var callback: ((Any?) -> Void)? + var proceedInWorkflow: ((Any?) -> Void)? typealias IntakeType = I diff --git a/docs/Classes.html b/docs/Classes.html index 49a444644..38ca74b1f 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -230,7 +230,7 @@

Declaration

diff --git a/docs/Classes/LinkedList.html b/docs/Classes/LinkedList.html index 52edc967a..7842217ec 100644 --- a/docs/Classes/LinkedList.html +++ b/docs/Classes/LinkedList.html @@ -1859,7 +1859,7 @@

Return Value

diff --git a/docs/Classes/LinkedList/Node.html b/docs/Classes/LinkedList/Node.html index ae85e2c16..7907e37d5 100644 --- a/docs/Classes/LinkedList/Node.html +++ b/docs/Classes/LinkedList/Node.html @@ -431,7 +431,7 @@

Declaration

diff --git a/docs/Classes/Workflow.html b/docs/Classes/Workflow.html index 473f17aad..d23bb834f 100644 --- a/docs/Classes/Workflow.html +++ b/docs/Classes/Workflow.html @@ -180,7 +180,7 @@

Return Value

diff --git a/docs/Enums.html b/docs/Enums.html index 995d9804d..051a58bea 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -122,7 +122,7 @@

Declaration

diff --git a/docs/Enums/PresentationType.html b/docs/Enums/PresentationType.html index 8a33ca6c2..592303b39 100644 --- a/docs/Enums/PresentationType.html +++ b/docs/Enums/PresentationType.html @@ -191,7 +191,7 @@

Declaration

diff --git a/docs/Extensions.html b/docs/Extensions.html index 1aeb8a02a..7cafaef19 100644 --- a/docs/Extensions.html +++ b/docs/Extensions.html @@ -118,7 +118,7 @@

Declaration

diff --git a/docs/Extensions/UIViewController.html b/docs/Extensions/UIViewController.html index 83c57b86f..d88c67e26 100644 --- a/docs/Extensions/UIViewController.html +++ b/docs/Extensions/UIViewController.html @@ -183,7 +183,7 @@

Parameters

diff --git a/docs/Protocols.html b/docs/Protocols.html index 2e5c88b11..a03a72891 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -209,7 +209,7 @@

Declaration

diff --git a/docs/Protocols/AnyFlowRepresentable.html b/docs/Protocols/AnyFlowRepresentable.html index 1a998ff69..b64672159 100644 --- a/docs/Protocols/AnyFlowRepresentable.html +++ b/docs/Protocols/AnyFlowRepresentable.html @@ -192,7 +192,7 @@

Return Value

diff --git a/docs/Protocols/FlowRepresentable.html b/docs/Protocols/FlowRepresentable.html index 68352a318..c48a0d37d 100644 --- a/docs/Protocols/FlowRepresentable.html +++ b/docs/Protocols/FlowRepresentable.html @@ -252,7 +252,7 @@

Return Value

diff --git a/docs/Protocols/Presenter.html b/docs/Protocols/Presenter.html index 97f0bf442..3488ff20d 100644 --- a/docs/Protocols/Presenter.html +++ b/docs/Protocols/Presenter.html @@ -204,7 +204,7 @@

Parameters

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes.html index 49a444644..38ca74b1f 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes.html @@ -230,7 +230,7 @@

Declaration

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList.html index 52edc967a..7842217ec 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList.html @@ -1859,7 +1859,7 @@

Return Value

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList/Node.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList/Node.html index ae85e2c16..7907e37d5 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList/Node.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/LinkedList/Node.html @@ -431,7 +431,7 @@

Declaration

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/Workflow.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/Workflow.html index 473f17aad..d23bb834f 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/Workflow.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Classes/Workflow.html @@ -180,7 +180,7 @@

Return Value

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums.html index 995d9804d..051a58bea 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums.html @@ -122,7 +122,7 @@

Declaration

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums/PresentationType.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums/PresentationType.html index 8a33ca6c2..592303b39 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums/PresentationType.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Enums/PresentationType.html @@ -191,7 +191,7 @@

Declaration

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions.html index 1aeb8a02a..7cafaef19 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions.html @@ -118,7 +118,7 @@

Declaration

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions/UIViewController.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions/UIViewController.html index 83c57b86f..d88c67e26 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions/UIViewController.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Extensions/UIViewController.html @@ -183,7 +183,7 @@

Parameters

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols.html index 2e5c88b11..a03a72891 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols.html @@ -209,7 +209,7 @@

Declaration

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/AnyFlowRepresentable.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/AnyFlowRepresentable.html index 1a998ff69..b64672159 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/AnyFlowRepresentable.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/AnyFlowRepresentable.html @@ -192,7 +192,7 @@

Return Value

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/FlowRepresentable.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/FlowRepresentable.html index 68352a318..c48a0d37d 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/FlowRepresentable.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/FlowRepresentable.html @@ -252,7 +252,7 @@

Return Value

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/Presenter.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/Presenter.html index 97f0bf442..3488ff20d 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/Presenter.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/Protocols/Presenter.html @@ -204,7 +204,7 @@

Parameters

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/badge.svg b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/badge.svg index 229251ab2..f6985a8a7 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/badge.svg +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/badge.svg @@ -19,10 +19,10 @@ documentation - 79% + 77% - 79% + 77% diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/index.html b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/index.html index eef4d2d94..fbaed5ed5 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/index.html @@ -124,7 +124,7 @@

The solution

diff --git a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/undocumented.json b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/undocumented.json index d3868c0fd..14dff62e0 100644 --- a/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/undocumented.json +++ b/docs/docsets/DynamicWorkflow.docset/Contents/Resources/Documents/undocumented.json @@ -51,14 +51,35 @@ }, { "file": "/Users/thompsty/workspace/Workflow/Workflow/Protocols/FlowRepresentable.swift", - "line": 66, + "line": 48, + "symbol": "FlowRepresentable.shouldLoad()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/thompsty/workspace/Workflow/Workflow/Protocols/FlowRepresentable.swift", + "line": 52, + "symbol": "FlowRepresentable.shouldLoad()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/thompsty/workspace/Workflow/Workflow/Protocols/FlowRepresentable.swift", + "line": 58, + "symbol": "FlowRepresentable.erasedShouldLoad(with:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/thompsty/workspace/Workflow/Workflow/Protocols/FlowRepresentable.swift", + "line": 73, "symbol": "FlowRepresentable.erasedShouldLoad(with:)", "symbol_kind": "source.lang.swift.decl.function.method.instance", "warning": "undocumented" }, { "file": "/Users/thompsty/workspace/Workflow/Workflow/Protocols/FlowRepresentable.swift", - "line": 71, + "line": 78, "symbol": "FlowRepresentable.proceedInWorkflow(_:)", "symbol_kind": "source.lang.swift.decl.function.method.instance", "warning": "undocumented" diff --git a/docs/docsets/DynamicWorkflow.tgz b/docs/docsets/DynamicWorkflow.tgz index 299e11f1f..ee8010a6f 100644 Binary files a/docs/docsets/DynamicWorkflow.tgz and b/docs/docsets/DynamicWorkflow.tgz differ diff --git a/docs/index.html b/docs/index.html index eef4d2d94..fbaed5ed5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -124,7 +124,7 @@

The solution

diff --git a/docs/undocumented.json b/docs/undocumented.json index 14dff62e0..65823ea90 100644 --- a/docs/undocumented.json +++ b/docs/undocumented.json @@ -87,7 +87,7 @@ { "file": "/Users/thompsty/workspace/Workflow/Workflow/Protocols/TypeErased/AnyFlowRepresentable.swift", "line": 20, - "symbol": "AnyFlowRepresentable.callback", + "symbol": "AnyFlowRepresentable.proceedInWorkflow", "symbol_kind": "source.lang.swift.decl.var.instance", "warning": "undocumented" }, @@ -122,7 +122,7 @@ { "file": "/Users/thompsty/workspace/Workflow/Workflow/UIKitPresenter/UIWorkflowItem.swift", "line": 49, - "symbol": "UIWorkflowItem.callback", + "symbol": "UIWorkflowItem.proceedInWorkflow", "symbol_kind": "source.lang.swift.decl.var.instance", "warning": "undocumented" },