The application is being made with swift now.
I'm having a hard time parsing the json file!
{[1, A, Ghana, 12345, abcd],
[2, A, Dara, 156489, abed],
[3, B, Maba, 189651, wqin],
[4, C, SAA, 189651, apeo]
let makeA = [1, A, Ghana, 12345, abcd] [2, A, Dara, 156489, abed]]
Let makeB = [3, B, Maba, 189651, ewqin]
Let makeC = [4, C, SaA, 189651, apeo]
I want to make it an array of makeA, makeB, and makeC like this!!!
swift json parsing
It's not a question of wanting to do something to do. The question to ask is, how do you translate this into English?
Maybe you want to do something like this.
For each of the [blah blah blah] shapes in the JSON, if there is a second element in the array, add "make" to the element to give it a new name, and pair "array" to the name.
This is what happens when you write this in English.
for each [ blah blah ] (say "TheArray") in the JSON,
if TheArray has second element,
let's make a new name (say "NewName") by putting "make" before that element
and let TheArray have that NewName
Huh? Don't you think it's going to be a code if you just translate it into swift? Try it!
© 2024 OneMinuteCode. All rights reserved.