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
+33-27Lines changed: 33 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,66 +84,72 @@ This will make reducer handle all routing relevant actions.
84
84
85
85
# Implementing `Routable`
86
86
87
-
ReSwiftRouter works with routes that are defined, similar to URLs, as a sequence of identifiers e.g. `["Home", "User", "UserDetail"]`.
87
+
ReSwiftRouter works with routes that are defined, similar to URLs, as a sequence of elements e.g. `["Home", "User", "UserDetail"]`.
88
88
89
89
ReSwiftRouter is agnostic of the UI framework you are using - it uses `Routable`s to implement that interaction.
90
90
91
-
Each route segment is mapped to one responsible `Routable`. The `Routable` needs to be able to present a child, hide a child or replace a child with another child.
91
+
Each route element is mapped to one responsible `Routable`. The `Routable` needs to be able to present a child, hide a child or replace a child with another child.
92
92
93
93
Here is the `Routable` protocol with the methods you should implement:
As part of initializing `Router` you need to pass the first `Routable` as an argument. That root `Routable` will be responsible for the first route segment.
119
+
As part of initializing `Router` you need to pass the first `Routable` as an argument. That root `Routable` will be responsible for the first route element.
112
120
113
-
If e.g. you set the route of your application to `["Home"]`, your root `Routable` will be asked to present the view that corresponds to the identifier`"Home"`.
121
+
If e.g. you set the route of your application to `["Home"]`, your root `Routable` will be asked to present the view that corresponds to the element`"Home"`.
114
122
115
123
When working on iOS with UIKit this would mean the `Routable` would need to set the `rootViewController` of the application.
116
124
117
-
Whenever a `Routable` presents a new route segment, it needs to return a new `Routable` that will be responsible for managing the presented segment. If you want to navigate from `["Home"]` to `["Home", "Users"]` the `Routable` responsible for the `"Home"`segment will be asked to present the `"User"`segment.
125
+
Whenever a `Routable` presents a new route element, it needs to return a new `Routable` that will be responsible for managing the presented element. If you want to navigate from `["Home"]` to `["Home", "Users"]` the `Routable` responsible for the `"Home"`element will be asked to present the `"User"`element.
118
126
119
-
If your navigation stack uses a modal presentation for this transition, the implementation of `Routable` for the `"Home"`segment might look like this:
127
+
If your navigation stack uses a modal presentation for this transition, the implementation of `Routable` for the `"Home"`element might look like this:
## Calling the Completion Handler within Routables
154
160
155
-
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.
161
+
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 `completion` handler. The router will not perform any further navigation actions until the completion handler is called.
156
162
157
163
# Changing the Current Route
158
164
@@ -165,7 +171,7 @@ Currently the only way to change the current application route is by using the `
165
171
)
166
172
}
167
173
```
168
-
As development continues, support for changing individual route segments will be added.
174
+
As development continues, support for changing individual route elements will be added.
0 commit comments