I have one array results which I am using to set another array filteredResult which contains some filtered value of the main results array.
var filteredResult: [Result] {
var result = self.results.filter({ $0.exclusive == true })
result = result.filter({ $0.name.localizedCaseInsensitiveContains("Test Name") })
return result
}
Now I will have to perform some task after this filteredResult array is set. So where to perform that task? I have tried didSet after get but I'm getting error
DidSet variable may not also have a get specifier
var filteredResult: [Result] {
get {
var result = self.results.filter({ $0.exclusive == true })
result = result.filter({ $0.name.localizedCaseInsensitiveContains("Test Name") })
return result
}
didSet {
}
}
I have checked this and this links. But not able to get the solution.
So kindly help me to understand how to perform some task after filteredResult is set with some filter value.