Skip to content

Commit d564793

Browse files
committed
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.
1 parent 8de9220 commit d564793

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

medium-story.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ VDFlow offers several advantages:
228228
4. **Natural deep linking** - Tree structure facilitates deep linking
229229
5. **SwiftUI integration** - Works with native SwiftUI patterns
230230
6. **Lightweight implementation** - Small binary size (~100KB) with minimal overhead
231+
7. **UI-agnostic design** - Manages only navigation state, not UI presentation
231232

232233
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.
233234

@@ -250,6 +251,51 @@ flow = .home(.feed(.reset)) // Using enum-like static functions
250251

251252
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.
252253

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+
struct FormFlow {
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+
struct MapViewState {
271+
var standard
272+
var satellite
273+
var traffic
274+
var locationDetails: LocationInfo?
275+
}
276+
277+
// Managing design system components
278+
@Steps
279+
struct ExpandableCardState {
280+
var collapsed
281+
var expanded: ExpansionState = .basic
282+
}
283+
284+
@Steps
285+
struct ExpansionState {
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+
253299
## Implementation Details
254300

255301
Adding VDFlow to a project is straightforward with Swift Package Manager:

0 commit comments

Comments
 (0)