That has nothing to do with structs. That is closure syntax, where the variable name before in
is the input argument to the closure.
In the context of SwiftUI, that closure is actually a ViewBuilder
, which is a specific type of a function builder. You can read more about function readers and the other syntactic sugars that made SwiftUI possible here.
You can learn the type of the closure input argument(s) by option clicking on them in Xcode, just like any other variables. Or you can check the documentation of GeometryReader
to learn what input arguments its closure accepts.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…