i got the array of dictionary in CartDataModal structure
class CartDataModal: NSObject {
static let shared_Inst = CartDataModal()
var cartArrayDict = [[String:Any]]()
}
the received data is in format below
restmenu is after inserting
[
["ItemName": Cheese Burger, "ItemPrice": 50, "ItemQuant": "2"],
["ItemName": Veg Burger, "ItemPrice": 30, "ItemQuant": 0],
["ItemName": Chicken Burger, "ItemPrice": 50, "ItemQuant": 0],
["ItemName": Veg & Crisp Burger, "ItemPrice": 45, "ItemQuant": 0],
["ItemName": Maharaja Burger, "ItemPrice": 60, "ItemQuant": 0],
["ItemName": Coke, "ItemPrice": 50, "ItemQuant": 0],
["ItemName": Pepsi, "ItemPrice": 50, "ItemQuant": 0]
]
how can i count the total number of keyValues for "ItemQuant"?
cartArrayDict.countfor the total number ofItemName, ifItemNameare not duplicate. You can add it into set to remove the redundancy.ItemNames?