|
|
|
|
|
by rudedogg
2095 days ago
|
|
Not sure if I'm missing something, but under the "Conditionals" heading there is an example. I've been writing a lot of SwiftUI code since it came out - and a common use is like that example. Imagine a settings UI where you want to only show an advanced option if a switch/checkbox is toggled. |
|
These just return their values -- the only one of note is that buildIf returns the empty array by default, but otherwise this is just defining an if statement to be an if statement.
It gives you however to make an if statement do something other than being an if statement, and that seems... bad.
You could for example define it as