SwiftUI composition exercises inspired by the Reminders view and strategies from Pacheco article, and Paul Hudson article/video on better SwiftUI views.
composing views : breaking views down into digestible components
Pacheco
- Variables
- Functions
- Separate Structs
- Limit level of abstraction
- Don't over compose
Hudson
- Make supplementary views properties
- Break larger views into smaller ones
- Get action code out of view body
- Create View extensions for Styling
- Use ButtonStyle and friends
If you are interested in working thru the tutorial,
git clone https://github.com/timcolson/tut-swiftui-comp
Start with v1...
git checkout tags/v1
FYI - to return back to the main version
git co main
v1 - initial working version
v2 - 𝚫 reminderListItems & newReminderButton to vars
v3 - make a func to display reminder
v4 - move ReminderItem to separate view
v5 - make view Modifier for style
v5.1 - use view modifier from extension