|
I am trying to make two classes conform to Codable. It throws this error with the Book class: "Cannot convert value of type 'volumeInfo' to expected argument type 'volumeInfo.Type'" How could I solve it?
|
|
Thanks for your great advices and for your help Obelix!!! I solved it... !!!! I have continued with the code to get a list of the books from my json file (just their names to start) but it shows nothing... Sure I am not doing several things right despite trying my best... it is really difficult for me because I have never done something related with this... but I am here and continue learning!!! Could you please tell me what I am doing wrong to try to fix it ??? Sometimes I feel embarrassed here for asking my questions, because I think they might be really easy or silly... but it is the way I find to solve them and to improve...
|
|
@Kitty is still having trouble. I think my hints were too vague? JSON isn't easy.Decoding other people's JSON data is not always easy. Many JSON files tend to look like Russian Stacking 🎎 Dolls. This is the case with the Google Book JSON. The outer element is To ease the pain, please study the following solution. I hope this helps you along your path. But you can't learn by simply copying this code. PLEASE take an hour or so and understand each line. Google Book Response
Some code to illustrate
Keep Coding!Please let us know if this helped. Share your questions and learning with us. |
|
I have been taking a long time to understand all of it!!!!! I understand most of it The really hardest part for me is the last one. The extension URLSession I haven't arrived there yet. I have read the article where he explains it. Thanks !!!!! |
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!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.