From 3ebc87b36c4220d59700d65563e0589c59ff44f3 Mon Sep 17 00:00:00 2001 From: Morgan Zellers Date: Tue, 28 Sep 2021 14:33:18 -0500 Subject: [PATCH 1/5] Updating documentation based on techical writing suggestions. --- Sources/SwiftCurrent/Models/Workflow.swift | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Sources/SwiftCurrent/Models/Workflow.swift b/Sources/SwiftCurrent/Models/Workflow.swift index 20b9f2ab4..d8a436e7b 100644 --- a/Sources/SwiftCurrent/Models/Workflow.swift +++ b/Sources/SwiftCurrent/Models/Workflow.swift @@ -13,7 +13,7 @@ import Foundation A doubly linked list of `FlowRepresentableMetadata`s; used to define a process. ### Discussion - In a sufficiently complex application it may make sense to create a structure to hold onto all the workflows in an application. + In a sufficiently complex application, it may make sense to create a structure to hold onto all the workflows in an application. #### Example ```swift @@ -49,7 +49,7 @@ public final class Workflow: LinkedList<_WorkflowItem> { Launches the `Workflow`. - Parameter orchestrationResponder: the `OrchestrationResponder` to notify when the `Workflow` proceeds or backs up. - Parameter launchStyle: the launch style to use. - - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` the workflow finished with. + - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` of the last node in the workflow. - Returns: the first loaded instance or nil, if none was loaded. */ @discardableResult public func launch(withOrchestrationResponder orchestrationResponder: OrchestrationResponder, @@ -71,7 +71,7 @@ public final class Workflow: LinkedList<_WorkflowItem> { - Parameter orchestrationResponder: the `OrchestrationResponder` to notify when the `Workflow` proceeds or backs up. - Parameter args: the arguments to pass to the first instance(s). - Parameter launchStyle: the launch style to use. - - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` the workflow finished with. + - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` of the last node in the workflow. - Returns: the first loaded instance or nil, if none was loaded. */ @discardableResult public func launch(withOrchestrationResponder orchestrationResponder: OrchestrationResponder, @@ -94,7 +94,7 @@ public final class Workflow: LinkedList<_WorkflowItem> { - Parameter orchestrationResponder: the `OrchestrationResponder` to notify when the `Workflow` proceeds or backs up. - Parameter passedArgs: the arguments to pass to the first instance(s). - Parameter launchStyle: the launch style to use. - - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` the workflow finished with. + - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` of the last node in the workflow. - Returns: the first loaded instance or nil, if none was loaded. */ @discardableResult public func launch(withOrchestrationResponder orchestrationResponder: OrchestrationResponder, @@ -285,7 +285,7 @@ extension Workflow { extension Workflow where F.WorkflowOutput == Never { /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -301,7 +301,7 @@ extension Workflow where F.WorkflowOutput == Never { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -317,7 +317,7 @@ extension Workflow where F.WorkflowOutput == Never { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -335,7 +335,7 @@ extension Workflow where F.WorkflowOutput == Never { extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -351,7 +351,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -371,7 +371,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -387,7 +387,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -403,7 +403,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -419,7 +419,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -437,7 +437,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { extension Workflow { /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -453,7 +453,7 @@ extension Workflow { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -473,7 +473,7 @@ extension Workflow { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -489,7 +489,7 @@ extension Workflow { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -505,7 +505,7 @@ extension Workflow { } /** - Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. From 1268370b6ff8ff571527b6185415b66c6aa91887 Mon Sep 17 00:00:00 2001 From: Morgan Zellers Date: Wed, 29 Sep 2021 09:36:13 -0500 Subject: [PATCH 2/5] Reverting changes that do not align with Swift API style guide --- Sources/SwiftCurrent/Models/Workflow.swift | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Sources/SwiftCurrent/Models/Workflow.swift b/Sources/SwiftCurrent/Models/Workflow.swift index d8a436e7b..b292f2c29 100644 --- a/Sources/SwiftCurrent/Models/Workflow.swift +++ b/Sources/SwiftCurrent/Models/Workflow.swift @@ -49,7 +49,7 @@ public final class Workflow: LinkedList<_WorkflowItem> { Launches the `Workflow`. - Parameter orchestrationResponder: the `OrchestrationResponder` to notify when the `Workflow` proceeds or backs up. - Parameter launchStyle: the launch style to use. - - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` of the last node in the workflow. + - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` the workflow finished with. - Returns: the first loaded instance or nil, if none was loaded. */ @discardableResult public func launch(withOrchestrationResponder orchestrationResponder: OrchestrationResponder, @@ -71,7 +71,7 @@ public final class Workflow: LinkedList<_WorkflowItem> { - Parameter orchestrationResponder: the `OrchestrationResponder` to notify when the `Workflow` proceeds or backs up. - Parameter args: the arguments to pass to the first instance(s). - Parameter launchStyle: the launch style to use. - - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` of the last node in the workflow. + - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` the workflow finished with. - Returns: the first loaded instance or nil, if none was loaded. */ @discardableResult public func launch(withOrchestrationResponder orchestrationResponder: OrchestrationResponder, @@ -94,7 +94,7 @@ public final class Workflow: LinkedList<_WorkflowItem> { - Parameter orchestrationResponder: the `OrchestrationResponder` to notify when the `Workflow` proceeds or backs up. - Parameter passedArgs: the arguments to pass to the first instance(s). - Parameter launchStyle: the launch style to use. - - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` of the last node in the workflow. + - Parameter onFinish: the closure to call when the last element in the workflow proceeds; called with the `AnyWorkflow.PassedArgs` the workflow finished with. - Returns: the first loaded instance or nil, if none was loaded. */ @discardableResult public func launch(withOrchestrationResponder orchestrationResponder: OrchestrationResponder, @@ -285,7 +285,7 @@ extension Workflow { extension Workflow where F.WorkflowOutput == Never { /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -301,7 +301,7 @@ extension Workflow where F.WorkflowOutput == Never { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -317,7 +317,7 @@ extension Workflow where F.WorkflowOutput == Never { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -335,7 +335,7 @@ extension Workflow where F.WorkflowOutput == Never { extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -351,7 +351,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -371,7 +371,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -387,7 +387,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -403,7 +403,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -419,7 +419,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -437,7 +437,7 @@ extension Workflow where F.WorkflowOutput == AnyWorkflow.PassedArgs { extension Workflow { /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a `FlowPersistence` representing how this item in the workflow should persist. @@ -453,7 +453,7 @@ extension Workflow { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure taking in the generic type from the `FlowRepresentable.WorkflowInput` and returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -473,7 +473,7 @@ extension Workflow { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -489,7 +489,7 @@ extension Workflow { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. @@ -505,7 +505,7 @@ extension Workflow { } /** - Adds an item to the workflow, and enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. + Adds an item to the workflow; enforces the `FlowRepresentable.WorkflowOutput` of the previous item matches the `FlowRepresentable.WorkflowInput` of this item. - Parameter type: a reference to the next `FlowRepresentable`'s concrete type in the workflow. - Parameter launchStyle: the `LaunchStyle` the `FlowRepresentable` should use while it's part of this workflow. - Parameter flowPersistence: a closure returning a `FlowPersistence` representing how this item in the workflow should persist. From f9f5d2c76c1f15862e8f7325cb371c0792a7544f Mon Sep 17 00:00:00 2001 From: Morgan Zellers Date: Wed, 29 Sep 2021 09:54:28 -0500 Subject: [PATCH 3/5] Applied suggested technical writing changes to documentation in UIViewControllerAdditions --- .../Extensions/UIViewControllerAdditions.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/SwiftCurrent_UIKit/Extensions/UIViewControllerAdditions.swift b/Sources/SwiftCurrent_UIKit/Extensions/UIViewControllerAdditions.swift index 0565cd4bd..d8215d587 100644 --- a/Sources/SwiftCurrent_UIKit/Extensions/UIViewControllerAdditions.swift +++ b/Sources/SwiftCurrent_UIKit/Extensions/UIViewControllerAdditions.swift @@ -83,10 +83,10 @@ extension UIViewController { extension FlowRepresentable where Self: UIViewController { /** - Called when the current workflow should be terminated, and the app should return to the point before the workflow was launched - - Parameter animated: A boolean indicating whether abandoning the workflow should be animated - - Parameter onFinish: A callback after the workflow has been abandoned. - - Note: In order to dismiss UIKit views the workflow must have an `OrchestrationResponder` that is a `UIKitPresenter`. + Called when the current workflow should be terminated, and the app should return to the point before the workflow was launched. + - Parameter animated: a boolean indicating whether abandoning the workflow should be animated. + - Parameter onFinish: a callback after the workflow has been abandoned. + - Note: In order to dismiss UIKit views, the workflow must have an `OrchestrationResponder` that is a `UIKitPresenter`. */ public func abandonWorkflow(animated: Bool = true, onFinish:(() -> Void)? = nil) { workflow?.abandon(animated: animated, onFinish: onFinish) From 383563acc96f63c3b1348da40212220e2c1ca606 Mon Sep 17 00:00:00 2001 From: Morgan Zellers Date: Wed, 29 Sep 2021 10:03:55 -0500 Subject: [PATCH 4/5] Applied suggested technical writing changes to documentation in FlowRepresentable.swift --- .../Protocols/FlowRepresentable.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift b/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift index 5ccf9969f..083d52437 100644 --- a/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift +++ b/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift @@ -21,7 +21,7 @@ import Foundation - Important: If you create a superclass that is a `FlowRepresentable` and expect subclasses to be able to define their own methods, such as `shouldLoad`, the superclass should declare those methods, and the subclasses should override them. Otherwise you will find the subclasses do not behave as expected. #### Example - A `FlowRepresentable` with a `WorkflowInput` of `String` and a `WorkflowOutput` of `Never` + A `FlowRepresentable` with a `WorkflowInput` of `String` and a `WorkflowOutput` of `Never`: ```swift class FR1: FlowRepresentable { // Mark this class as `final` to avoid the required keyword on init weak var _workflowPointer: AnyFlowRepresentable? @@ -29,7 +29,7 @@ import Foundation } ``` - A `FlowRepresentable` with a `WorkflowInput` of `Never` and a `WorkflowOutput` of `Never` + A `FlowRepresentable` with a `WorkflowInput` of `Never` and a `WorkflowOutput` of `Never`: ```swift final class FR1: FlowRepresentable { // Classes synthesize an empty initializer already, you are good! weak var _workflowPointer: AnyFlowRepresentable? @@ -37,7 +37,7 @@ import Foundation ``` #### Note - Declaring your own custom initializer can result in a compiler error with an unfriendly message + Declaring your own custom initializer can result in a compiler error with an unfriendly message. ```swift class FR1: FlowRepresentable { // Results in compiler error for 'init()' being unavailable weak var _workflowPointer: AnyFlowRepresentable? @@ -56,11 +56,11 @@ public protocol FlowRepresentable { A pointer to the `AnyFlowRepresentable` that erases this `FlowRepresentable`; will automatically be set. ### Discussion - This property is automatically set by a `Workflow`, it simply needs to be declared on a `FlowRepresentable`. - In order for a `FlowRepresentable` to have access to the `Workflow` that launched it, store the closures for proceeding forward and backward, and provide type safety, it needs this property available for writing. + This property is automatically set by a `Workflow`; it simply needs to be declared on a `FlowRepresentable`. + In order for a `FlowRepresentable` to have access to the `Workflow` that launched it, store the closures for proceeding forward and backward, and provide type safety. It needs this property available for writing. #### Note - While not strictly necessary it would be wise to declare this property as `weak`. + While not strictly necessary, it would be wise to declare this property as `weak`. */ var _workflowPointer: AnyFlowRepresentable? { get set } @@ -68,7 +68,7 @@ public protocol FlowRepresentable { Creates a `FlowRepresentable`. #### Note - This is auto synthesized by FlowRepresentable, and is only called when `WorkflowInput` is `Never`. + This is auto-synthesized by FlowRepresentable, and is only called when `WorkflowInput` is `Never`. */ init() /// Creates a `FlowRepresentable` with the specified `WorkflowInput`. @@ -87,7 +87,7 @@ public protocol FlowRepresentable { ### Discussion This method is called *after* `init` but *before* any other lifecycle events. It is non-mutating and should not change the `FlowRepresentable`. - - Important: If you create a superclass that is a `FlowRepresentable` and expect subclasses to define their own `shouldLoad` the superclass should declare `shouldLoad`, and the subclasses should override it. Otherwise you will find the subclasses do not behave as expected. + - Important: If you create a superclass that is a `FlowRepresentable` and expect subclasses to define their own `shouldLoad`, the superclass should declare `shouldLoad`, and the subclasses should override it. Otherwise you will find the subclasses do not behave as expected. #### Note Returning `false` can have different behaviors depending on the `FlowPersistence`. From b81c508b0308b1eb610a33a349cc6f889b0378ff Mon Sep 17 00:00:00 2001 From: Morgan Zellers Date: Thu, 30 Sep 2021 08:29:18 -0500 Subject: [PATCH 5/5] Removing colons. --- Sources/SwiftCurrent/Protocols/FlowRepresentable.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift b/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift index 083d52437..e687a8cdf 100644 --- a/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift +++ b/Sources/SwiftCurrent/Protocols/FlowRepresentable.swift @@ -21,7 +21,7 @@ import Foundation - Important: If you create a superclass that is a `FlowRepresentable` and expect subclasses to be able to define their own methods, such as `shouldLoad`, the superclass should declare those methods, and the subclasses should override them. Otherwise you will find the subclasses do not behave as expected. #### Example - A `FlowRepresentable` with a `WorkflowInput` of `String` and a `WorkflowOutput` of `Never`: + A `FlowRepresentable` with a `WorkflowInput` of `String` and a `WorkflowOutput` of `Never` ```swift class FR1: FlowRepresentable { // Mark this class as `final` to avoid the required keyword on init weak var _workflowPointer: AnyFlowRepresentable? @@ -29,7 +29,7 @@ import Foundation } ``` - A `FlowRepresentable` with a `WorkflowInput` of `Never` and a `WorkflowOutput` of `Never`: + A `FlowRepresentable` with a `WorkflowInput` of `Never` and a `WorkflowOutput` of `Never` ```swift final class FR1: FlowRepresentable { // Classes synthesize an empty initializer already, you are good! weak var _workflowPointer: AnyFlowRepresentable?