Thank you for your answer.
After changes in codes the result looks the same. To make it more clear I have tableView which include array with structs. Typing in search bar still filter me just name of Category with all Sign positions, instead of searched Sign what is my point.
class Sign {
let code: String
let name: String
let description: String
let picture: String
init(code: String, name: String, description: String, picture: String) {
self.code = code
self.name = name
self.description = description
self.picture = picture
}
}
class Category {
let name: String
let sign: [Sign]
init(name: String, sign: [Sign]) {
self.name = name
self.sign = sign
}
}
Looking for showing name from Sign in my table after typing in search bar. I think your code is closer but still append category.
Eg.
var categories: [Category] = [
Category(name: "X", sign: [Sign(code: "X-1", name: "Xxx"),
Category(name: "Y", sign: [Sign(code: "Y-1", name: "Yyy"),
After typing "yy" || "y" in search bar I need my tableView shows only Sign which contains "yy".