You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,18 +13,18 @@ mainStore.dispatch(
13
13
)
14
14
```
15
15
16
-
#About ReSwiftRouter
16
+
#About ReSwiftRouter
17
17
18
18
**ReSwiftRouter is still under development and the API is neither complete nor stable at this point.**
19
19
20
20
When building apps with ReSwift you should aim to cause **all** state changes through actions - this includes changes to the navigation state.
21
21
22
22
This requires to store the current navigation state within the app state and to use actions to trigger changes to that state - both is provided ReSwiftRouter.
23
23
24
-
#Installation
24
+
#Installation
25
25
26
26
27
-
##CocoaPods
27
+
##CocoaPods
28
28
29
29
You can install ReSwiftRouter via CocoaPods by adding it to your `Podfile`:
30
30
@@ -35,16 +35,16 @@ You can install ReSwiftRouter via CocoaPods by adding it to your `Podfile`:
35
35
36
36
pod 'ReSwift'
37
37
pod 'ReSwiftRouter'
38
-
38
+
39
39
And run `pod install`.
40
40
41
-
##Carthage
41
+
##Carthage
42
42
43
43
You can install ReSwiftRouter via [Carthage]() by adding the following line to your Cartfile:
44
44
45
45
github "ReSwift/ReSwiftRouter"
46
46
47
-
#Configuration
47
+
#Configuration
48
48
49
49
Extend your app state to include the navigation state:
We'll discuss `Routable` in the next main section.
69
69
70
-
##Calling the Navigation Reducer
70
+
##Calling the Navigation Reducer
71
71
72
72
The `NavigationReducer` is provided as part of `ReSwiftRouter`. You need to call it from within your top-level reducer. Here's a simple example from the specs:
73
73
@@ -82,7 +82,7 @@ struct AppReducer: Reducer {
82
82
```
83
83
This will make reducer handle all routing relevant actions.
84
84
85
-
#Implementing `Routable`
85
+
#Implementing `Routable`
86
86
87
87
ReSwiftRouter works with routes that are defined, similar to URLs, as a sequence of identifiers e.g. `["Home", "User", "UserDetail"]`.
ReSwiftRouter needs to throttle the navigation actions, since many UI frameworks including UIKit don't allow to perform multiple navigation steps in parallel. Therefor every method of `Routable` receives a `completionHandler`. The router will not perform any further navigation actions until the completion handler is called.
156
156
157
-
#Changing the Current Route
157
+
#Changing the Current Route
158
158
159
159
Currently the only way to change the current application route is by using the `SetRouteAction` and providing an absolute route. Here's a brief example:
160
160
@@ -168,8 +168,8 @@ Currently the only way to change the current application route is by using the `
168
168
As development continues, support for changing individual route segments will be added.
169
169
170
170
171
-
#Contributing
171
+
#Contributing
172
172
173
-
##Compiling & Running tests
173
+
##Compiling & Running tests
174
174
175
175
ReSwiftRouter uses [Carthage]() for its development dependencies. To build or test any of the targets, run `carthage bootstrap`.
0 commit comments