Here I have a SwiftUI view called EnumView
that is an enum
rather than a struct
.
It has three cases: red, blue and green.
For each case it unsurprisingly returns a Color
, which conforms to View
.
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.