Great tutorial, one of the better explanations so far! I like the clarity and the step-by-step approach which is easy to follow. Doing those few design examples also helps a lot. Also liked your explanation of what went wrong. I also like the fact you're using one of the latest current versions at this moment, which certainly helps following along. Subbed!
Thanks you are a STAR, I am 63 years and start learning SwiftUI, I have apps on the Appstore for the last 10 years all written in Obj-C. I have a question for you please; my .json file has got 540 000 line items, I want to do a search for a STRING before I display the data. I did follow your example. Can you maybe when and where to the SEARCH function. Thanks Pierre
Can this be done with the latest version of macOS or will I need to revert? When I create my private var I get a warning that my app quick unexpectedly and if I click reopen it says "You can't use this version of the application "appname" with this version of macOS."
@@Indently This did not work. I've tried re-coding and it's still the same issue.. it's in the finder and everything.. not sure why it doesn't see the file.
@@Indently Okay thank you! Now it got past the first gaurd statement and saying it's not able to decode the file. Would that be a problem with my .json or my code itself?
I've never liked JSONDecoder() much as JSONSerialization(). The former is easy, but it requires an exact struct that matches the incoming JSON data. There are ways around this, but it's very messy and kills the simplicity of JSONDecoder(). Besides, having an exact model somewhat defeats the while purpose of JSON data in the first place. Things change over the life of a system. Adding new fields, for example, to the incoming JSON data will crash old code using JSONDecoder(). JSONSerialization() is more procedural in nature, but is also more intuitive and allows for default values for missing JSON fields, and also for easily ignoring irrelevant JSON fields. JSONDecoder() is for prototyping and RUclips videos, at best. I wouldn't use it in production apps.
Hi Federico, thanks for your tutorial.. I have a problem with a JSON file or the app crashes when it starts decoding and therefore the data is not loaded. I noticed that the JSON file is a little different from yours in the video example, I downloaded it from Facebook to test and I got the Facebook JSON file with all the friends in my account and the format is this: { "friends_v2": [ { "name": "Test Test", "timestamp": 1678361485 }, { "name": "Test2 ", "timestamp": 1678318229 }, { "name": "Test 3", "timestamp": 1675869376 } ] } As you can see the file doesn't start with name and timestamp but before them there is "friends_v2". I noticed that if I delete that "friend_v2" everything works otherwise it doesn't. In case I get uneditable JSON like this (so I can't delete "friend_v2" how can I make everything work by following your example in the video? what code change should I make? Thank you very much for your time
Great tutorial, one of the better explanations so far! I like the clarity and the step-by-step approach which is easy to follow. Doing those few design examples also helps a lot. Also liked your explanation of what went wrong. I also like the fact you're using one of the latest current versions at this moment, which certainly helps following along. Subbed!
Nice. This is the next step in my project I am working on and haven’t yet been able to figure out how to do it. Great help as usual. 👍🏻
The most simple and easiest explanation thank you for your work
Awesome. Thank you. Exactly what I wanted in the format I needed.
Excellent tutorial. Finally I understand how to do this. Thanks!!
Glad it helped!
Woww, what a great tutorial! Subscribed!!
Thanks you are a STAR, I am 63 years and start learning SwiftUI, I have apps on the Appstore for the last 10 years all written in Obj-C. I have a question for you please; my .json file has got 540 000 line items, I want to do a search for a STRING before I display the data. I did follow your example. Can you maybe when and where to the SEARCH function. Thanks Pierre
Thanks from Russia
very legitimate explanation 🤗👏
great tutorial!! thank you!
if you can stock your json file on ligne where is the best place to host JSON file ?
Thank you. It helped me a lot.
Can this be done with the latest version of macOS or will I need to revert? When I create my private var I get a warning that my app quick unexpectedly and if I click reopen it says "You can't use this version of the application "appname" with this version of macOS."
How do I encode and append an object back to the JSON file?
After decode its become a let and I can't make changes on struct.
Thanks !
I don't get it, why did we have that bug
Hey, if i'm pulling a request from an API, what should i change ?
I’m in the same situation, what did you do to solve it?
Hi there ! I want to use json from URL how can i do this ?
I’m in the same situation, what did you do to solve it?
I'm still getting "could not find intel.json in project" I dragged it in and it's there. I even put them all in the same group.
Try closing Xcode and reopening it
@@Indently This did not work. I've tried re-coding and it's still the same issue.. it's in the finder and everything.. not sure why it doesn't see the file.
@@FinnishArmy Otherwise you need to try creating a new empty file, CMD + N > Search "Empty" > Pick "Other Empty", and name it YOUR_NAME.json
@@Indently Okay thank you! Now it got past the first gaurd statement and saying it's not able to decode the file. Would that be a problem with my .json or my code itself?
@@d42 thanks I finished the project a while back, but yea
I've never liked JSONDecoder() much as JSONSerialization(). The former is easy, but it requires an exact struct that matches the incoming JSON data. There are ways around this, but it's very messy and kills the simplicity of JSONDecoder(). Besides, having an exact model somewhat defeats the while purpose of JSON data in the first place. Things change over the life of a system. Adding new fields, for example, to the incoming JSON data will crash old code using JSONDecoder(). JSONSerialization() is more procedural in nature, but is also more intuitive and allows for default values for missing JSON fields, and also for easily ignoring irrelevant JSON fields. JSONDecoder() is for prototyping and RUclips videos, at best. I wouldn't use it in production apps.
Hi Federico, thanks for your tutorial.. I have a problem with a JSON file or the app crashes when it starts decoding and therefore the data is not loaded. I noticed that the JSON file is a little different from yours in the video example, I downloaded it from Facebook to test and I got the Facebook JSON file with all the friends in my account and the format is this:
{
"friends_v2": [
{
"name": "Test Test",
"timestamp": 1678361485
},
{
"name": "Test2 ",
"timestamp": 1678318229
},
{
"name": "Test 3",
"timestamp": 1675869376
}
]
}
As you can see the file doesn't start with name and timestamp but before them there is "friends_v2". I noticed that if I delete that "friend_v2" everything works otherwise it doesn't. In case I get uneditable JSON like this (so I can't delete "friend_v2" how can I make everything work by following your example in the video? what code change should I make? Thank you very much for your time
I am also having a similar issue with the decode function. It just says it can not decode.