https://www.hackingwithswift.com/books/ios-swiftui/understanding-the-basic-structure-of-a-swiftui-app#:~:text=Third%2C%20var%20body%3A%20some%20View%20defines%20a%20new,to%20the%20View%20protocol%2C%20which%20is%20our%20layout.
Third, var body: some View defines a new computed property called body, which has an interesting type: some View. This means it will return something that conforms to the View protocol, which is our layout. Behind the scenes this will actually result in a very complicated data type being returned based on all the things in our layout, but some View means we don’t need to worry about that.`
body is a computed property and is not using a closure. You're saying there's a body property that is of type some View and it's value is a computed one not an assigned one like:
let someInt = 25
a simpler computed property:
var computedInt: Int {
5 * 5
}
and now body as a computed property:
var body: some View {
Text("Hello, world!)
}
The picker is an example of where you are using a trailing closure:
Picker(titleKey: LocalizedStringKey, selection: Binding< >, content: () -> _)
You specify the first two values and then provide a closure for the content:
Picker("Select your student", selection: $selectedStudent) {
ForEach(students, id: \.self) {
Text($0)
}
}
The same with ForEach. It also has a trailing closure.
see also:
https://www.donnywals.com/what-are-computed-properties-in-swift-and-when-should-you-use-them/#:~:text=A%20computed%20property%20in%20Swift%20is%20a%20property,a%20very%20basic%20example%20of%20a%20computed%20property%3A