Post

I really like the first option. I was trying to get ViewBuilder to work in that way but I kept thinking the other branch would be EmptyView() and not nil so it wouldn't work for me. I think I'll adopt that version but keep the ifAvailable name as I like the reminder to avoid other if statements.

I think the second option reorders the logic in a strange way and it wouldn't work if you had multiple else if branches. I'm impressed by your effort to make it work by abusing the strange workings of ViewBuilder though. The second closure doesn't even look like valid code!