Am getting crash for data type conversion mismatch. how to change data type in swift to rectify this issue?
var Createsections: [[String:Any]] = [[String:Any]]()
var TableData: [[String:Any]] = [[String:Any]]()
for item in TableData {
if let subcategories = item["subcategories"] as? [Any] {
for item_list in subcategories {
// item_list contain string value - Household
Createsections.append(item_list as! [String: Any])// this line crash for me.
}
} }
I want to append that String Value into Createsections.