我试图解决的问题与重新实现List.
所以例如我有这个:
struct MyList<Content: View>: View {
var content: Content
init(@ViewBuilder content: @escaping () -> Content) {
self.content = content()
}
var body: some View {
content
}
}
这里我的内容可以是 a Section、 aView或TupleView由Sections 或 others组成的 a View,甚至可以是嵌套ForEach的 s(so others Sections)。如何将内容平面映射到一个简单的Sections 数组?