Swift UI : Unable to infer complex closure return type; add explicit type to disambiguate
1 min readOct 31, 2019
Return only one view.
To do that, Group many views into one view:
Many Views
VStack(alignment: .center){
ForEach(my, id:\.self){row in
Button(action: {}){
Spacer()
Text("\(row)")}
Spacer()
}
}
Into one view with Group {}
VStack(alignment: .center){
ForEach(my, id:\.self){row in
Button(action: {}){
Group{
Spacer()
Text("\(row)")}
Spacer()
}
}
}
}