SwiftUI-Tutorials | code example and translation project | iOS library
kandi X-RAY | SwiftUI-Tutorials Summary
kandi X-RAY | SwiftUI-Tutorials Summary
A code example and translation project of SwiftUI. / A code example and translation project of SwiftUI.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SwiftUI-Tutorials
SwiftUI-Tutorials Key Features
SwiftUI-Tutorials Examples and Code Snippets
Community Discussions
Trending Discussions on SwiftUI-Tutorials
QUESTION
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 type to disambiguate
I'm using the same code as the tutorial (even coping from the 'Complete' sample code doesn't resolve the error).
Does anyone have a cue what is going wrong here?
...ANSWER
Answered 2019-Jun-04 at 21:12The 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:
- Declare
isFavorite
variable on theLandmark
type. - Make sure you update the
landmarkData.json
for every landmark record with theisFavorite = false
entry, otherwise the app will crash at runtime.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SwiftUI-Tutorials
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page