I want to create array of array
ex-
let myImages: [[String]] = [
["image_url_0_0", "image_url_0_1", "image_url_0_2", "image_url_0_3"],
["image_url_1_0", "image_url_1_1", "image_url_1_2"],
["image_url_2_0", "image_url_2_1", "image_url_2_2", "image_url_2_3", "image_url_2_4"]
]
I tried this, but it doesn't work perfectly.
var myArray :[[String]] = []
for custom_attributes! in items { // items is the json items array
var arrImage: [String] = []
for customParams in custom_attributes! {
if let attCode = customParams["attribute_code"] as? String, attCode == "small_image" {
print(customParams["value"])
var myString = customParams["value"] as! String
arrImage.append(myString)
}
}
myArray.append(arrImage)
}
But I get result in this form
[["image_url_0_0"], ["image_url_0_0","image_url_0_1"], ["image_url_0_0","image_url_0_1","image_url_0_3"].....]
How should I do this?Please Help.