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.