一、正常的代码,能够运行swift
struct ContentView: View { var body: some View { Group { Text("1") Text("2 ") Text("3 ") Text("4 ") Text("5 ") Text("6 ") Text("7 ") Text("8 ") Text("9 ") Text("10 ") //Text("11 ") } } }
二、会提示编译错误的代码xcode
struct ContentView: View { var body: some View { Group { Text("1") Text("2 ") Text("3 ") Text("4 ") Text("5 ") Text("6 ") Text("7 ") Text("8 ") Text("9 ") Text("10 ") Text("11 ") } } }
build时会出现下面的错误app
Argument passed to call that takes no arguments
xcode的提示实在是太莫名其妙了,我经过查看文档才发现。SwiftUI 的container是有数量限制,具体限制多少呢。文档里面没有写明(也多是咱们没有找到),可是文档下面的buildblock没有超过10的ui
后来我又google一下,果真有这个限制。google
下面的容器都是有10个对象的限制spa
我认为应该是apple不但愿咱们建立过于复杂的单页视图,但愿咱们尽快进行模块划分。code