I was trying to create a complex Array
in the playground with the way below:
import UIKit
let demoData = [
[
"name":"Mr Bean",
"number": "012345678",
"address": "4 D. Street",
"dob": "21-9-1970",
"gender": "male",
"docs": [
"alerts":["jt_alert_1.jpg", "jt_alert_2.jpg"],
"notes":["jt_notes_1.png", "jt_notes_2.jpg", "jt_notes_3.jpg", "jt_notes_4.jpg"],
"correspondence": [],
"investigations": [],
"operationsheets": [],
"treatmentcharts": []
]
],
[
"name":"Jenny Thomas",
"number": "012345679",
"address": "5 D. Street",
"dob": "22-9-1970",
"gender": "female",
"docs": [
"alerts":[],
"notes":[],
"correspondence": [],
"investigations": [],
"operationsheets": [],
"treatmentcharts": []
]
]
];
let notes: AnyObject? = demoData[0]["docs"]!["notes"]!
let notePics = notes as Array<String>
notePics[0]
The spinning wheel at the bottom right corner keeps spinning for ever. When i created a new swift project, the same code froze everything while XCode was indexing
Does anyone else had the same problem? If yes, any solutions?
Thanks in advance