Skip to content

Commit

Permalink
[master] - 'Let's start trying to document things - TT'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler-Keith-Thompson committed Sep 9, 2019
1 parent 7ae13bc commit c0ab08d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
- XCode Version: [e.g. XCode 10.2]
- CucumberSwift Version: [e.g. 2.1.24]
- Workflow Version: [e.g. 2.1.24]
- Example Feature File (if applicable)
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,40 @@
### Welcome to Workflow!
Workflow is a library meant to handle complex user flows in iOS applications.

MORE DETAIL TO COME SOON
#### Table of Contents:
- [Insallation](installation)
- [Why DynamicWorkflow?](why-this-library)
- [Getting Started](getting-started)
- [Testing Your Workflows](testing)
- [Advanced](advanced)
- [Developer Documentation](dev-docs)
- [FAQ](faq)

### The problem DynamicWorkflow was built to solve:
When developing for iOS one view controller has to know about the one following it in order to pass along daa. Imagine a workflow for a fast food app.

Pick a location -> Pickup or Delivery -> Catering Menu or Normal Menu -> Choose Food -> Review Order -> Submit payment

Now imagine if a users location is known via GPS. You may be able to skip the first screen and assume the nearest location knowing they can edit it on the review screen. Pickup or Delivery may or may not need to show up depending on what the location they picked supports, Same with catering menu vs normal menu

Finally the review screen would be really nice if it gave a way to edit. This spells a nightmare for you if you utilize UIStoryboardSegue to help. You'll have to use many of them, and if the design of this user flow changes you're in for a bit of an annoying time changing them around.


### The solution
DynamicWorkflow lets you specify once what the whole workflow looks like, then each view controller defines whether it should show up or not, so to solve the above problem you'd use something like this.

```swift
let workflow:Workflow = [
LocationsViewController.self,
PickupOrDeliveryViewController.self,
MenuChooserViewController.self,
FoodChooserViewController.self,
ReviewOrderViewController.self,
SubmitPaymentViewController.self
]

//from wherever this flow is launched
launchInto(workflow)
```

If you ever want to re-order these you simply move their position in the array. Your ViewControllers will be naturally start to become defined in a way where they can be injected into any kind of workflow and so if for scheduled orders you want screens to show up in a different order, you just define a new `Workflow`.

0 comments on commit c0ab08d

Please sign in to comment.