🔰conditional modifier
SwiftUI ⟩ view ⟩ modifier ⟩ conditional modifier
Change view modifiers conditionally
Circle()
// ⭐️ conditional modifier (`isOn`: @State view property)
.foregroundColor( isOn ? .red : .yellow )
ternary conditional operator ( a ? b : c)
Last updated
Was this helpful?