【发布时间】:2020-06-12 09:58:31
【问题描述】:
在Apple SwiftUI Tutorial: Drawing Paths and Shapes 上,显示以下语法:
struct Badge: View {
var body: some View {
GeometryReader { geometry in
Path { path in
...
}
.fill(Color.black)
}
}
}
没有看到Swift docs on structs中的语法,感觉很迷茫。
此外,无论这意味着什么,人们怎么会知道geometry 是“在”GeometryReader 语句中的?
【问题讨论】:
-
错误的章节。它在Closures