Closure containing a declaration cannot be used with function builder ‘ViewBuilder’

 HStack{
            //...
            let lebus = "IOS Super Lecturer"/ /... }Copy the code

Error cause:

The bottom layer of the SwiftUI StackView (HStack, VStack, ZStack) currently supports only if and else statements.

(Maybe support it later)

Solutions:

Put statements other than if and else in a calculated property outside of the body.