Skip to content

Commit c6748dd

Browse files
committed
readme: improve multiple flows explanations
1 parent 5463e71 commit c6748dd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,25 @@ class WatchedViewModel: Stepper {
194194
}
195195
```
196196

197+
### Is it possible to coordinate multiple Flows ?
198+
199+
Of course, it is the aim of a Coordinator. As a Flow is a Presentable, a Flow can launch one other Flow or even several other Flows.
200+
201+
For instance, from the WishlistFlow, we launch the SettingsFlow in a popup.
202+
203+
```swift
204+
private func navigateToSettings () -> [Flowable] {
205+
let settingsStepper = SettingsStepper()
206+
let settingsFlow = SettingsFlow(withService: self.service, andStepper: settingsStepper)
207+
Flows.whenReady(flow: settingsFlow, block: { [unowned self] (root: UISplitViewController) in
208+
self.rootViewController.present(root, animated: true)
209+
})
210+
return [Flowable(nextPresentable: settingsFlow, nextStepper: settingsStepper)]
211+
}
212+
```
213+
214+
For a more complex case, see the **MainFlow.swift** file in which we handle a UITabBarController.
215+
197216
### How to bootstrap the RxFlow process
198217

199218
The coordination process is pretty straightfoward and happens in the AppDelegate.

0 commit comments

Comments
 (0)