I make perform HTTP Request by this command
let task = URLSession.shared.dataTask(with: request) { (data, response, error)
and get back my data in JSONDecoder, then I do this
let groceryPro = try decoder.decode(GroceryProduct.self, from: data!)
where my GroceryProduct is:
struct GroceryProduct: Codable {
var data: [Data1]
}
struct Data1: Codable {
var id: String?
var name: String?
var system_name: String?
var type: String?
var lang: String?
var is_global: Int?
}
I got a big array, this is one value from it, in total there are ≈ 700:
Data1(id: Optional("9"), name: Optional("войти"), system_name: Optional("login"), type: Optional("button"), lang: Optional("ru"), is_global: Optional(1))
I need to call the array that matches some requirements, for an example, if system_name : "Esc" then I need to get this array
filter().