-1
このJSONから件名配列を選びたいと思います。JSON配列を選択
[
{
"program_id": "1",
"program": "O levels",
"subjects": [
{
"program_id": "1",
"program": null,
"subject_id": "1",
"subject_code": "4037",
"subject_name": "Add-Maths",
"subject_image": ""
}
]
}
これは私のコードです。
for result in json["programs"].array! {
let json2 = JSON(result["subjects"].arrayValue)
let type = json2["program_id"].arrayValue
let type1 = json2["program_id"].stringValue
self.collectionarray1.append(Explore_model_for_collectionview.init(
Explore_program_id: json2["program_id"].stringValue,
Explore_program: json2["program"].stringValue,
Explore_subject_id: json2["subject_id"].stringValue,
Explore_subject_code: json2["subject_code"].stringValue,
Explore_subject_name: json2["subject_name"].stringValue,
Explore_subject_image: json2["subject_image"].stringValue))
あなたは何を求めていますか? –