|
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 !!!!! |
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
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.