Skip to content

Commit 7a7d7c5

Browse files
committed
Refactor README for improved readability
1 parent 8e01dd8 commit 7a7d7c5

File tree

4 files changed

+5
-56
lines changed

4 files changed

+5
-56
lines changed

README.md

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,13 @@ Use **Swift Package Manager**:
4242

4343
### Step 1: Define your routes
4444

45-
```swift
46-
enum AppRoute: ANRoute {
47-
case home
48-
case settings
49-
case item(id: String)
50-
}
51-
```
45+
![Route](assets/route.png)
46+
47+
---
5248

5349
### Step 2: Initialize the app with a config
5450

55-
```swift
56-
@main
57-
struct AwesomeNavigationExampleApp: App {
58-
var body: some Scene {
59-
WindowGroup {
60-
let config = ANConfig(initialRoute: AppRoute.home) { route in
61-
switch route {
62-
case .home: HomeView()
63-
case .settings: SettingsView()
64-
case .item(let id): ItemView(id: id)
65-
}
66-
}
67-
68-
ANApplication(with: config)
69-
.preferredColorScheme(.dark)
70-
}
71-
}
72-
}
73-
```
51+
![App](assets/app.png)
7452

7553
---
7654

@@ -80,36 +58,7 @@ You can use the provided navigation methods from any view using `@EnvironmentObj
8058

8159
### Example: HomeView
8260

83-
```swift
84-
struct HomeView: View {
85-
@EnvironmentObject var nav: AwesomeNavigation
86-
87-
var body: some View {
88-
List {
89-
Section("PUSH") {
90-
Button("Push Settings View") {
91-
nav.push(AppRoute.settings)
92-
}
93-
94-
Button("Push Item View") {
95-
nav.push(AppRoute.item(id: UUID().uuidString))
96-
}
97-
}
98-
99-
Section("POP") {
100-
Button("Pop One View") {
101-
nav.pop()
102-
}
103-
104-
Button("Pop to Root") {
105-
nav.popToRoot()
106-
}
107-
}
108-
}
109-
.navigationTitle("Home")
110-
}
111-
}
112-
```
61+
![Navigate](assets/navigate.png)
11362

11463
---
11564

assets/app.png

190 KB
Loading

assets/navigate.png

226 KB
Loading

assets/route.png

96.7 KB
Loading

0 commit comments

Comments
 (0)