I had a View which should render a GridView in the beta 4 everything worked great but in the beta 5 of Xcode 11 and beta 5 of macOS Catalina it stoped working.
struct List : View {
var rows: [[Int]]
var spacing: CGFloat = (screen.width-330)/4
var list: [ReminderModel]
var number: Int
var body: some View {
return VStack {
ForEach(rows, id: \.self) { row in
HStack(spacing: self.spacing) { //The error is at this bracket
ForEach(row) { item in
Reminder(closed: self.list[item].closed, text: self.list[item].text)
self.number % 3 == 0 ? nil : VStack() {
self.number-1 == item ? AddReminder() : nil
}
}
Spacer()
}.padding(.top, self.spacing).padding(.leading, self.spacing)
}
if self.number % 3 == 0 {
HStack() {
AddReminder().padding(.leading, self.spacing).padding(.top, self.spacing)
Spacer()
}
}
}
}
}
Error: Unable to infer complex closure return type; add explicit type to disambiguate
Update 1: I found that the problem is this part of the code:
self.number % 3 == 0 ? nil : VStack() {
self.number-1 == item ? AddReminder() : nil
}
I also tried this but also didn't work:
if (self.number % 3 != 0 && self.number-1 == item) {
AddReminder()
}