I want to not show a swiftui view under several conditions, e.g. a[3]==3 or b[17]==3. This can be implemented as:
if a[3]!=3 && b[17]!=3 {
Text("show view")
}
However, the number of elements of a and b is variable and 3 or 17 might be out of range. Therefore, one might think of the following code:
if true {
if a.count > 3 {
if a[3]==3 {
break
}
}
if b.count>17 {
if b[17]==7 {
break
}
}
Text("show view")
}
However, in a swiftui view, break is not available. Furthermore, this code does not really look elegant.