一、正常的代碼,能夠運行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