Unfortunately, we can’t do this directly. After a bit of searching and toying around, I arrived at a good solution thanks to this Stack Overflow post.

#swift #swiftui #mobile #ios

How to Conditionally Apply View Modifiers in SwiftUI
14.40 GEEK