Skip to content

Commit

Permalink
readme: add a migration guide for v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
twittemb committed Mar 11, 2018
1 parent 331e1c5 commit 7137faa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ You will find a very detail explanation of the whole project on my blog:
The Jazzy documentation can be seen here as well: [Documentation](http://community.rxswift.org/RxFlow/)

# Migrating from v1.0.x to v1.1.0
There are two major changes that must be taken care of if you want to use the v1.1 when coming from an older version:
There are two major changes that must be taken care of if you want to use the v1.1.0 when coming from an older version:
- **Flowable** has been replaced by **NextFlowItem**. It's exactly the same idea between those 2 names, but "Flowable" was too much related to a Protocol naming convention. The **Flow.navigate(to:)** function has to return a **NextFlowItems**, which is an enum that represents different possibilities of NextFlowItem (multiple, one, none, ...). Take a look at the code snippets below to see some examples.
- In order to improve RxFlow consistency, it seemed obvious that a Flow that presents a UIViewController also **HAS** to dismiss it. In previous versions, a child Flow was dismissed by itself and not by the Flow that presented it. In the Demo Application you will find an example with the WishlistFlow dismissing the SettingsFlow for the **settingsDone** Step.

# Migrating from v1.x.x to v1.3.0
There are two major changes that must be taken care of if you want to use the v1.3.0 when coming from an older version:
- **NextFlowItems.stepNotHandled** has been removed for the sake of simplicity. If you want a received step to have no effect at all in a **navigate(to:)** function, all you need to do is returning a **NextFlowItems.none** value. It means that no new **Stepper** will be registered in the Coordinator.
- **NextFlowItems.end(withStepForParentFlow: Step)** allows to explicitly tell the Coordinator that you want to dismiss the current Flow. You can pass the Step you want the parent Flow to receive in its **navigate(to:)** function. That is where you will dismiss the child Flow root **Presentable**. It can be also used to pass data to the parent **
Flow** thanks to an enum parameter (withStepForParentFlow could be something like: DemoStep.loginIsComplete(idUser: xxx))

The DemoApp has been updated to implement those changes. It shows how to swap between 2 Flows attached to the root Window.

# Navigation concerns
Regarding navigation within an iOS application, two choices are available:
- Use the builtin mechanism provided by Apple and Xcode: storyboards and segues
Expand Down

0 comments on commit 7137faa

Please sign in to comment.