|
Hello everyone! I'm almost finished with BucketList's challenge but I found this error: This is my code:
|
|
Try to retype |
|
Thanks for replying! I did that but now it appears a new error in the In the ContentView, the ViewModel was created like this --> I'm working in the challenge and I created the ViewModel for the EditView. This is it:
|
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th. Sponsor Hacking with Swift and reach the world's largest Swift community! |
|
That is correct Just remove the $ at the switch:
That is what I have... |
|
Thanks @VulcanCCIT ! That helped but now I'm getting this error: |
|
|
|
The error message "The compiler is unable to type-check this expression in reasonable time" is common in Swift. It means the compiler is confused, either because of a syntax error in your code or a bug in the compiler. Usually, refactoring your view into smaller views either will solve the problem or will result in a more informative error message. In this case, try refactoring |
|
I do not think the suggestin that @bobstern has is it as I just checked the HackingWithSwift+ solution and your code is almost identical with the exception of the .toolbar { } code, the solution has a slightly different save function but other than that your code is spot on. Just to be sure comment out the code in between the brackets after your Button("Save") { //comment out this code} but I would suggest first to clean your build folder and or start xcode over...both have solved your issue for me in other code. Hope that helps! |
|
Actually it does not look like you are passing information correctly to your save function...try this:
|
|
Thanks @VulcanCCIT and @bobstern ! I forgot to remove the |
|
@KeyBarreto glad I could help! I didnt catch the $ at the ForEach that has tripped me up before as well! |
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.