I want to change the configuration of the screen in iOS sdk version.
The general method can be solved in this way.
@ViewBuilder
func PermissionItemView(_ icon: String, _ title:String, _ text: String) -> some View {
if #available(iOS 15, *) {
HStack {
}
.listRowSeparator(.hidden)
}
else {
HStack {
}
}
}
However, to reduce the weight of the program code,
I want to do the same as the Define Macro in C++.
@ViewBuilder
func PermissionItemView(_ icon: String, _ title:String, _ text: String) -> some View {
HStack {
}
if #available(iOS 15, *) {
.listRowSeparator(.hidden)
}
}
Is there a way?