Re:A Girl and Her ViewBuilder
by saagarjha on Sunday February 25, 2024 @02:31PM
(#39503952)
You know, I never really understood why ViewModifier exists at all. How is it different from an extension on View?
[ Parent
| on HN ]
Re:A Girl and Her ViewBuilder
by TheNightman on Sunday February 25, 2024 @06:47PM
(#39506178)
A viewmodifier can have its own @State, etc. I can’t think of anything that couldn’t be accomplished with an extension on View with a few tricks but ViewModifiers are easier & cleaner IMO. I usually have a ViewModifier along with an extension on view used to apply it