Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToDone

ToDone is a basic "demo" project for navigation using the SwiftUI Navigation library from Point Free.

Usage

Move functionality and state into model classes (out of views)

  • Observable Object - preferred over @State for testability and deep linking

Model holds @Published data (e.g., array of items)

  • Navigation based on Enum Optional
  • Enum is @CasePathable from SwiftUI Navigation library
  • Cases based on event/action and associated value binding passed in
  • Navigation destination property stored in optional of enum type
  • Optional parameter to initializer for deep linking
  • Model functions called based on actions (UI) for functionality and destination

View binds Model Destination property for navigation

  • SwiftUI Navigation library adds sheet modifier based on enum
  • .sheet modifier uses case path optional (set in functions in model) for navigation and binding
  • Dismissing the sheet resets the navigation optional to nil
  • .navigationDestination is similar
  • Other navigation documentation

License

MIT

About

Navigation demo for SwiftUI Navigation by Point Free

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages