Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The docs were using thenPresent but they should be using thenProceed #185

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/UPGRADE_PATH.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav
<summary><b>V3 -> V4</b></summary>

## 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`
Expand All @@ -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
Expand All @@ -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
```
Expand All @@ -43,7 +43,7 @@ Our directions are written for only 1 major version upgrade at a time, as we hav

<details>
<summary><b>V2 -> V3</b></summary>

### 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**
Expand All @@ -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
Expand All @@ -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()
.thenPresent(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)
```
Expand All @@ -101,21 +101,21 @@ 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.
morganzellers marked this conversation as resolved.
Show resolved Hide resolved

If you were using some of the methods from our WorkflowExampleTests please look at how they're set up now, they're drastically different.
</details>

---

<details>
<summary><b>V1 -> V2</b></summary>

### 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.
</details>
4 changes: 2 additions & 2 deletions .github/abstract/Creating Workflows in UIKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FirstViewController: UIWorkflowItem<String, String>, 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.
Expand All @@ -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(with: SecondViewController.self) // SwiftCurrent

launchInto(workflow, args: "Some starting arguments")
}
Expand Down
2 changes: 1 addition & 1 deletion .github/guides/Using Programmatic Views.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ViewController: UIViewController {

@objc private func didTapLaunchWorkflow() {
let workflow = Workflow(FirstViewController.self) // SwiftCurrent
.thenPresent(SecondViewController.self) // SwiftCurrent
.thenProceed(with: SecondViewController.self) // SwiftCurrent

launchInto(workflow, args: "Noble Six") { passedArgs in // SwiftCurrent
workflow.abandon()
Expand Down
4 changes: 2 additions & 2 deletions .github/guides/Using Storyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ import SwiftCurrent_UIKit
class ViewController: UIViewController {
@IBAction private func launchWorkflow() {
let workflow = Workflow(FirstViewController.self) // SwiftCurrent
.thenPresent(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 {
Expand Down