Following part 3 of Apple\'s tutorial on SwiftUI, Handling User Input, I get this error:
Unable to infer complex closure return type; add explicit ty
The issue is not with the closure, but with the isFavorite
property on landmark.
It is not declared on the Landmark
type, and the compiler instead of showing the undeclared property error, unable to resolve the stacks build closure return type, so it shows and error there.
Great job Apple tutorial writers and even better one Xcode11 compiler.
To fix:
isFavorite
variable on the Landmark
type. landmarkData.json
for every landmark record with the isFavorite = false
entry, otherwise the app will crash at runtime.