There is an ability to run code related to version of OS:
if #available(macOS 11.0, *) {
Button("test", action: {})
//.modifier1
//.modifier2
//.modifier3
//.modifier4
//.modifier5
//.modifier6
//.modifier7
//.modifier8
.foreground(.red)
} else {
Button("test", action: {})
//.modifier1
//.modifier2
//.modifier3
//.modifier4
//.modifier5
//.modifier6
//.modifier7
//.modifier8
}
Is it possible to do the same on single modifier without duplication of code?
Sth like syntax:
Button("test", action: {})
//.modifier1
//.modifier2
//.modifier3
//.modifier4
//.modifier5
//.modifier6
//.modifier7
//.modifier8
.if(macOS 11.0, *) { $0.foreground(.red) }
?