I would like to know why in SwiftUI ListStyle types are structs and not enums
You mean why is it a protocol, not an enum? No idea. Note that SwiftUI questions are out of scope on this forum.
my apologies meant Liststyle types
Most SwiftUI view styles are user extensible, though ListStyle
is not currently, but could be in the future. Tthe design is the same as all other view styles. If it's an enum
, then it cannot be extended/implemented by user. Look at LabelStyle
, ButtonStyle
: you can implement the protocol for your own style.
3 Likes