Skip to content

Commit

Permalink
Update guideline and podspec.
Browse files Browse the repository at this point in the history
  • Loading branch information
lm2343635 committed Jun 24, 2019
1 parent 4cb42aa commit 54a381c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion RxController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'RxController'
s.version = '0.7.1'
s.version = '0.7.2'
s.summary = 'A library for developing with MVVM-C based on RxFlow and RxSwift.'

# This description is used to generate tags and improve search results.
Expand Down
22 changes: 21 additions & 1 deletion document/chapter2-rxflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,24 @@ func signup() {
}
```

**All screen transitions should be managed in the flows.**
**All screen transitions should be managed in the flows.**

## 2.3 Present navigation controller in a step

If a navigation controller is presented in a step, you should pay attention to the memory leak issue.
A navigation controller has a root view controller named `rootViewController` which is a subclass of RxController.
**DO NOT** return `.viewController(rootViewController)` directly in this step.
Because he navigation controller is not managed by the RxFlow, a memory leak issue will be caused when this flow is ended.

**Return `.navigationController(navigationController)` in the step, if a navigation controller with a root view controller, which is a subclass of RxController, is presented.**

```swift
case .childOnNavigation:
guard let menuViewController = navigationController.topViewController as? MenuViewController else {
return .none
}
let infoViewController = InfoViewController(viewModel: InfoViewModel())
let navigationController = UINavigationController(rootViewController: infoViewController)
menuViewController.present(navigationController, animated: true)
return .navigationController(navigationController)
```

0 comments on commit 54a381c

Please sign in to comment.