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
Add UI-agnostic design section to medium-story.md, detailing VDFlow's capability to manage navigation state independently of UI presentation. Include examples for managing complex forms, UI components, and design system states, emphasizing versatility in various scenarios.
Copy file name to clipboardExpand all lines: medium-story.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,7 @@ VDFlow offers several advantages:
228
228
4.**Natural deep linking** - Tree structure facilitates deep linking
229
229
5.**SwiftUI integration** - Works with native SwiftUI patterns
230
230
6.**Lightweight implementation** - Small binary size (~100KB) with minimal overhead
231
+
7.**UI-agnostic design** - Manages only navigation state, not UI presentation
231
232
232
233
Unlike some navigation solutions that add significant binary weight or require restructuring an entire app, VDFlow is focused on solving the navigation problem specifically, with minimal overhead.
This preservation of state is crucial for maintaining form data, scroll positions, or other UI state when navigating between screens. When a complete reset is needed, the `@Steps` macro generates enum-like static functions for convenient initialization with new values.
252
253
254
+
## Beyond Screen Navigation
255
+
256
+
While many navigation libraries focus specifically on screen presentation, VDFlow is fundamentally UI-agnostic. It manages navigation state only, not UI presentation directly, making it versatile for various scenarios:
257
+
258
+
```swift
259
+
// Managing a complex form with multiple sections
260
+
@Steps
261
+
structFormFlow {
262
+
var personalInfo
263
+
var address
264
+
var payment
265
+
var review
266
+
}
267
+
268
+
// Controlling UI components within a single screen
269
+
@Steps
270
+
structMapViewState {
271
+
var standard
272
+
var satellite
273
+
var traffic
274
+
var locationDetails: LocationInfo?
275
+
}
276
+
277
+
// Managing design system components
278
+
@Steps
279
+
structExpandableCardState {
280
+
var collapsed
281
+
var expanded: ExpansionState = .basic
282
+
}
283
+
284
+
@Steps
285
+
structExpansionState {
286
+
var basic
287
+
var detailed
288
+
}
289
+
```
290
+
291
+
This separation of navigation state from UI presentation means VDFlow can be used for:
292
+
- Full-screen navigation
293
+
- Tab and section management
294
+
- Component state within a single screen
295
+
- Wizard and multi-step forms
296
+
- Design system component states
297
+
- Any UI element that has multiple states or configurations
298
+
253
299
## Implementation Details
254
300
255
301
Adding VDFlow to a project is straightforward with Swift Package Manager:
0 commit comments