I'm finishing an app that needs user data entry fields. I modeled it with a small number of data elements to streamline the development. Today I attempted to add additional elements and was astounded to find that I could only add 10 views to a view. So I tried the simplest of designs (below). If I added 11 "things" to the view it immediately presented the error on the top item, whatever it was:
"Argument passed to call that takes no arguments"
Doesn't matter whether I call the outside container a ScrollView, VStack, List or Form. Same behavior. Doesn't matter whether the Text/TextField sub units are in a VStack or not.
So I went back to basics - just added ten Text views. No problem. Add an eleventh and it blows up. Here's one of the variants - but all I need to do was add 10 simple Text views to get it to break.
I must be missing something really basic here. I checked for a newer release of Xcodebut I have Version 11.2 beta 2 (11B44), the latest.
@State private var textField1: String = "Pass to the ListCell"
@State private var textField2: String = "2"
//more of these
var body: some View {
NavigationView {
VStack {
//extract the VStack and create a separate struct
ListCell(tfString: textField1)
VStack {
Text("Text Field")
TextField("Placeholder", text: $textField2)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding()
}
VStack {
Text("Text Field")
TextField("Placeholder", text: $textField3)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding()
}
//more of the above VStacks
Text("6")
Text("7")
Text("8")
Text("9")
Text("10")
//Spacer()
//Text("11")
}
}
}
Any guidance would be appreciated.