Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Using State and Binding Without The @ Symbol

Using State and Binding Without The @ Symbol

Daily Coding Tip 096

Millie Sturgeon's avatar
Millie Sturgeon
Jun 02, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Using State and Binding Without The @ Symbol
Share
Image by ykaiavu from Pixabay

If you’re wanting what the @State and @Binding decorations are actually doing, they’re creating a generic type of the same name. Creating a @State variable with an initial value of false, as seen below, really creates the generic type State<Bool>.

In a comment above, I’ve provided a version that works the same way.

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