Ich finde es Toll wie du auf die ganzen Themen eingehst, durch deine Videoreihe konnte ich erst richtig verstehen wie man mit Swift umgeht. Genau auf dieses Video habe ich gewartet. Ich bin gerade dabei an meiner App über die Socket.IO Schnittstelle Live Daten (im JSON Format) an die App zu senden komme seit Tagen nicht weiter, weil mir Swift immer nur Fehler auswirft. Danke :)
Hey thank you for explanations, everything works perfectly besides one last thing: let breeds: [Breed]. Even though I did everything like you, I still get the error 39:31 but with stringValue: "breeds" instead
Hello, what does a JSON file mean? I dont understand anything about those computer tools and files. I just found a random fhir.json 2 file on my iphone in my documents. Could this be a spyware or is it just some other document scrypt from my iphone? ( i did not put it on my phone ) thats why i tought it is weird. You would really help me! Thank you in advance
This is really great! I wish I'd seen these first two videos ~6 months ago when I was first learning about working with APIs - really a good explanation of how they work and how you create your model, even a bit more complicated models. Maybe this will be brought up in the third video, but for the fake boolean (like hairless, with Int result of 0 or 1), would it be better to decode the JSON as is (with Int), but then assign the true/false value in a separate view model based on the Int result? It seems really messy to try to assign true/false while decoding, especially if you wanted to use a lot of the returned results.
Glad you found the API explanations helpful. I had the impression a lot of other material skips over the basic, which was a problem for me too when I was learning about APIs. About the Boolean decoding. I used this as an example for more advanced data formatting. You could leave it in as an Int. But this might confuse you later on in a larger project, when you forgot that this number should be used as a Boolean. After a couple of weeks or months, you might not directly remember everything. I am okay writing larger models that reduce the complexity for other parts of the app like in the views. In a company project, the backend engineering will probably have a Boolean value directly in the JSON, which means you don't have to work that much on the models. Also, the company will have some form of design rules for how to write certain types of code to make the code more uniform and easier to understand for multiple people. For you personal project, if you are the only one using this code, you can set your own conventions and stick with the Int.