From 0caeef971527b1bcf55fffa8b329eb0522675100 Mon Sep 17 00:00:00 2001 From: Nick Kaczmarek Date: Thu, 3 Mar 2022 09:08:07 -0600 Subject: [PATCH 1/2] [updating-docs-to-not-use-deprecated-apis] - Updating docs to use thenProceed over thenPresent. - nk --- .github/UPGRADE_PATH.md | 2 +- .github/abstract/Creating Workflows in UIKit.md | 4 ++-- .github/guides/Using Programmatic Views.md | 2 +- .github/guides/Using Storyboards.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/UPGRADE_PATH.md b/.github/UPGRADE_PATH.md index 5e60cbe62..60edd4251 100644 --- a/.github/UPGRADE_PATH.md +++ b/.github/UPGRADE_PATH.md @@ -73,7 +73,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav We no longer allow empty workflows, so if you instantiated a workflow like this: ```swift Workflow() - .thenPresent(EnterAddressViewController.self) + .thenProceed(EnterAddressViewController.self) ``` Then you will need to update it to this: ```swift diff --git a/.github/abstract/Creating Workflows in UIKit.md b/.github/abstract/Creating Workflows in UIKit.md index 2dd4a310a..54587b433 100644 --- a/.github/abstract/Creating Workflows in UIKit.md +++ b/.github/abstract/Creating Workflows in UIKit.md @@ -26,7 +26,7 @@ class FirstViewController: UIWorkflowItem, FlowRepresentable { / } ``` -> **Note:** Call `FlowRepresentable.proceedInWorkflow()` to have your view move forward to the next item in the `Workflow` it is part of. +> **Note:** Call `FlowRepresentable.proceedInWorkflow()` to have your view move forward to the next item in the `Workflow` it is part of. ### Step 2 Define your `Workflow` and launch it. This is what allows you to configure or reorder your workflow. @@ -36,7 +36,7 @@ Define your `Workflow` and launch it. This is what allows you to configure or re // From the ViewController you'd like to launch the workflow @objc private func didTapLaunchWorkflow() { let workflow = Workflow(FirstViewController.self) // SwiftCurrent - .thenPresent(SecondViewController.self) // SwiftCurrent + .thenProceed(SecondViewController.self) // SwiftCurrent launchInto(workflow, args: "Some starting arguments") } diff --git a/.github/guides/Using Programmatic Views.md b/.github/guides/Using Programmatic Views.md index 8a6a60263..fcafce465 100644 --- a/.github/guides/Using Programmatic Views.md +++ b/.github/guides/Using Programmatic Views.md @@ -156,7 +156,7 @@ class ViewController: UIViewController { @objc private func didTapLaunchWorkflow() { let workflow = Workflow(FirstViewController.self) // SwiftCurrent - .thenPresent(SecondViewController.self) // SwiftCurrent + .thenProceed(SecondViewController.self) // SwiftCurrent launchInto(workflow, args: "Noble Six") { passedArgs in // SwiftCurrent workflow.abandon() diff --git a/.github/guides/Using Storyboards.md b/.github/guides/Using Storyboards.md index 1a5ec1338..20594e0a0 100644 --- a/.github/guides/Using Storyboards.md +++ b/.github/guides/Using Storyboards.md @@ -141,7 +141,7 @@ import SwiftCurrent_UIKit class ViewController: UIViewController { @IBAction private func launchWorkflow() { let workflow = Workflow(FirstViewController.self) // SwiftCurrent - .thenPresent(SecondViewController.self) // SwiftCurrent + .thenProceed(SecondViewController.self) // SwiftCurrent launchInto(workflow, args: "Some Name") { passedArgs in // SwiftCurrent workflow.abandon() From 3a8c41e88012ac7dcb9b5fdd112c365155670951 Mon Sep 17 00:00:00 2001 From: Nick Kaczmarek Date: Thu, 3 Mar 2022 11:59:28 -0600 Subject: [PATCH 2/2] [updating-docs-to-not-use-deprecated-apis] - The API is actually thenProceed(with:) - nk --- .github/UPGRADE_PATH.md | 24 +++++++++---------- .../abstract/Creating Workflows in UIKit.md | 2 +- .github/guides/Using Programmatic Views.md | 2 +- .github/guides/Using Storyboards.md | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/UPGRADE_PATH.md b/.github/UPGRADE_PATH.md index 60edd4251..e292e8daf 100644 --- a/.github/UPGRADE_PATH.md +++ b/.github/UPGRADE_PATH.md @@ -7,7 +7,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav V3 -> V4 ## Name Change - The library changed its name from "Workflow" to "SwiftCurrent". This change was an important step for us, because it helps with SEO and gives people a sense that the library isn't just some generic thing slapped together. + The library changed its name from "Workflow" to "SwiftCurrent". This change was an important step for us, because it helps with SEO and gives people a sense that the library isn't just some generic thing slapped together. ### If you're using CocoaPods Update your `Podfile` to replace instances of `DynamicWorkflow` with `SwiftCurrent` @@ -16,7 +16,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav pod 'SwiftCurrent' # NEW ``` - Then update your import statements + Then update your import statements ```swift // import Workflow // OLD import SwiftCurrent // NEW @@ -32,7 +32,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav ```swift // import Workflow // OLD import SwiftCurrent // NEW - + // import WorkflowUIKit // OLD import SwiftCurrent_UIKit // NEW ``` @@ -43,7 +43,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav
V2 -> V3 - + ### Package Management NOTE: We support both SwiftPM and CocoaPods now, pick whichever suits your needs best. The primary difference is that SwiftPM has different `import` statements for `import Workflow` and `import WorkflowUIKit`, CocoaPods just uses `import Workflow`. #### **Update Pods** @@ -56,7 +56,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav ### IF YOU USE STORYBOARDS There is now a protocol for those using Storyboards called StoryboardLoadable. See [the docs](https://wwt.github.io/SwiftCurrent/Protocols/StoryboardLoadable.html) for more info. - + **IMPORTANT**: `StoryboardLoadable` has a minimum requirement of iOS 13. Be a little cautious of the Xcode fix-it here, it'll encourage you to add an `@available` attribute, or it may tell you to implement `_factory` methods. This is not correct, instead if you plan on using `StoryboardLoadable` you should just set your minimum iOS target to 13, otherwise you've gotta hand roll something. The implementation of `StoryboardLoadable` may help with hand rolling if that is what you decide to do. ### FlowRepresentable has Changed @@ -73,9 +73,9 @@ Our directions are written for only 1 major version upgrade at a time, as we hav We no longer allow empty workflows, so if you instantiated a workflow like this: ```swift Workflow() - .thenProceed(EnterAddressViewController.self) + .thenProceed(with: EnterAddressViewController.self) ``` - Then you will need to update it to this: + Then you will need to update it to this: ```swift Workflow(EnterAddressViewController.self) ``` @@ -101,12 +101,12 @@ Our directions are written for only 1 major version upgrade at a time, as we hav self?.proceedInWorkflow(order) } ``` - + ### The way you Test has Changed You used to be able to re-assign `proceedInWorkflow` to assert it was called with the args you expected, this has now slightly changed. - To get the *exact* behavior as before use `_proceedInWorkflow` to re-assign that closure. + To get the *exact* behavior as before use `_proceedInWorkflow` to re-assign that closure. There's also `proceedInWorkflowStorage` which gives you the `AnyWorkflow.PassedArgs` used when `proceedInWorkflow` was called. - + If you were using some of the methods from our WorkflowExampleTests please look at how they're set up now, they're drastically different.
@@ -114,8 +114,8 @@ Our directions are written for only 1 major version upgrade at a time, as we hav
V1 -> V2 - + ### License Change - + The biggest change here was a license change. We moved from MIT to Apache 2.0. Please assess and make sure you are willing to accept the new license.
diff --git a/.github/abstract/Creating Workflows in UIKit.md b/.github/abstract/Creating Workflows in UIKit.md index 54587b433..5e32b3d01 100644 --- a/.github/abstract/Creating Workflows in UIKit.md +++ b/.github/abstract/Creating Workflows in UIKit.md @@ -36,7 +36,7 @@ Define your `Workflow` and launch it. This is what allows you to configure or re // From the ViewController you'd like to launch the workflow @objc private func didTapLaunchWorkflow() { let workflow = Workflow(FirstViewController.self) // SwiftCurrent - .thenProceed(SecondViewController.self) // SwiftCurrent + .thenProceed(with: SecondViewController.self) // SwiftCurrent launchInto(workflow, args: "Some starting arguments") } diff --git a/.github/guides/Using Programmatic Views.md b/.github/guides/Using Programmatic Views.md index fcafce465..4357dceec 100644 --- a/.github/guides/Using Programmatic Views.md +++ b/.github/guides/Using Programmatic Views.md @@ -156,7 +156,7 @@ class ViewController: UIViewController { @objc private func didTapLaunchWorkflow() { let workflow = Workflow(FirstViewController.self) // SwiftCurrent - .thenProceed(SecondViewController.self) // SwiftCurrent + .thenProceed(with: SecondViewController.self) // SwiftCurrent launchInto(workflow, args: "Noble Six") { passedArgs in // SwiftCurrent workflow.abandon() diff --git a/.github/guides/Using Storyboards.md b/.github/guides/Using Storyboards.md index 20594e0a0..90fc15b44 100644 --- a/.github/guides/Using Storyboards.md +++ b/.github/guides/Using Storyboards.md @@ -141,8 +141,8 @@ import SwiftCurrent_UIKit class ViewController: UIViewController { @IBAction private func launchWorkflow() { let workflow = Workflow(FirstViewController.self) // SwiftCurrent - .thenProceed(SecondViewController.self) // SwiftCurrent - + .thenProceed(with: SecondViewController.self) // SwiftCurrent + launchInto(workflow, args: "Some Name") { passedArgs in // SwiftCurrent workflow.abandon() guard case .args(let emailAddress as String) = passedArgs else {