swift - Indexing into JSON object -


i have json object in shape of:

let allsnippets = [<metdocument key: <collection: snippets, id: xnmjqh5n3hbomnatk>, fields: {         text = "first snippet";     }>, <metdocument key: <collection: snippets, id: kvqwnwfyto5ixxsni>, fields: {         text = "second snippet";     }>] 

how can index , example text "second snippet" fields ?

i tried this:

    let json = json(allsnippets)     if let text = json[1]["text"].string{         print(text)     } 

but did not work.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

android - Go back to previous fragment -