Type Safely

Type Safely

Share this post

Type Safely
Type Safely
A ColorPicker That Sets and Stores Your View's Foreground Colour Within a ViewModifier

A ColorPicker That Sets and Stores Your View's Foreground Colour Within a ViewModifier

Daily Coding Tip 094

Millie Sturgeon's avatar
Millie Sturgeon
May 31, 2022
∙ Paid

Share this post

Type Safely
Type Safely
A ColorPicker That Sets and Stores Your View's Foreground Colour Within a ViewModifier
Share
Image by Sergio Cerrato - Italia from Pixabay

Okay, so a ViewModifier isn’t the best place to store data.

But I’ve realised that I haven’t spent enough time thinking about what a ViewModifier can do, as it is a structure that can use a @State property wrapper.

Whatever view we apply this modifier to is turned into the label of a Button. This gives the use…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share