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-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
</p>
12
12
13
13
## About the Project
14
-
This is my example of an easy-to-use **Navigation Coordinator**, written in just 50 lines of code and built using SwiftUI **NavigationStack** (iOS 16).
14
+
Easy-to-use **Navigation Coordinator**, written in just 50 lines of code and built using the SwiftUI **NavigationStack** (iOS 16).
15
15
16
16
## Core Features
17
17
The current implementation covers 4 main transitions:
@@ -27,7 +27,8 @@ The current implementation covers 4 main transitions:
27
27
- Swift 5.7+
28
28
29
29
## Why This Is Interesting
30
-
The implementation of the `unwind` transition may be of particular interest to those who have already attempted to create similar transitions in SwiftUI.
30
+
- The implementation of the `unwind` transition may be of particular interest to those who have already attempted to create similar transitions in SwiftUI.
31
+
- In addition to the specific task of multi-level return, the `unwind()` function can also be used instead of the usual `pop()` when it is necessary to pass data back to the previous screen. This can be critically important for unidirectional architectures. The `onUnwind()` call will be made before the `onAppear()` call.
31
32
32
33
## Usage Examples
33
34
@@ -114,13 +115,13 @@ struct A: View {
114
115
</details>
115
116
116
117
## Using into Your Project
117
-
This is simply an example of a navigation approach. Feel free to take it, modify it, and use it as you see fit.
118
+
Feel free to take it, modify it, and use it as you see fit.
118
119
119
-
You can simply take the [NavigationCoordinator.swift](https://github.com/silkodenis/swiftui-navigation-coordinator/tree/main/Navigation/Navigation/NavigationCoordinator.swift) and use it as you see fit in your project. It is an independent and tested component that manages `NavigationPath`.
120
+
You can take only the [NavigationCoordinator](https://github.com/silkodenis/swiftui-navigation-coordinator/tree/main/Navigation/Navigation/NavigationCoordinator.swift) and use it as you see fit in your project. It is an independent and tested component that manages the `NavigationPath`.
120
121
121
-
Or you can utilize the full [infrastructure](https://github.com/silkodenis/swiftui-navigation-coordinator/tree/main/Navigation/Navigation) from my example:
122
+
But I recommend utilizing the full [infrastructure](https://github.com/silkodenis/swiftui-navigation-coordinator/tree/main/Navigation/Navigation) from my example:
122
123
123
-
<details>
124
+
<detailsopen>
124
125
<summary><b>RootView</b></summary>
125
126
126
127
Configure the App to run with RootView.
@@ -153,10 +154,10 @@ struct SomeApp: App {
153
154
```
154
155
</details>
155
156
156
-
<details>
157
+
<detailsopen>
157
158
<summary><b>Scene</b></summary>
158
159
159
-
Configure the `Scene` for your project. In the view property, I recommend not using direct View initialization, but instead employing your favorite Dependency Injection pattern, such as 'View Factory', to connect various dependencies to your 'ViewModel' from outside.
160
+
Configure the `Scene` for your project. In the view property, I recommend avoiding direct View initialization. Instead, use your preferred Dependency Injection pattern, such as **View Factory**, to externally connect various dependencies to your **ViewModel**.
160
161
161
162
```swift
162
163
importSwiftUI
@@ -202,10 +203,10 @@ extension Screen {
202
203
```
203
204
</details>
204
205
205
-
<details>
206
+
<detailsopen>
206
207
<summary><b>UnwindSegueModifier</b></summary>
207
208
208
-
Finally, add `UnwindViewModifier.swift` to your project.
209
+
Finally, add the `UnwindViewModifier` to your project to implement the `onUnwind()` call in your view, similar to `onAppear()`.
209
210
210
211
```swift
211
212
importSwiftUI
@@ -233,4 +234,4 @@ extension View {
233
234
234
235
## License
235
236
236
-
Apache License 2.0 license. See the [LICENSE](https://github.com/silkodenis/swiftui-navigation-coordinator/blob/main/LICENSE) file for details.
237
+
**Apache License 2.0**. See the [LICENSE](https://github.com/silkodenis/swiftui-navigation-coordinator/blob/main/LICENSE) file for details.
0 commit comments