My model class is as below :
struct Job: Decodable, Equatable, Hashable {
var id: Int?
var status: String?
var priority: String?
}
I have 2 array of objects(job) as :
var jobModel = [Job]()
var filteredJobModel = [Job]()
Case : jobModel has 5 elements. filteredJobModel has 2 elements( subset of jobModel ). In filteredJobModel, the value for status for both objects has been changed by search operation.
I would like to update the jobModel back with filteredJobModel, where the object matches the id attribute.
Is there any way by which I can achieve this case? I would have been able to use filter & map for [String], but, I would like to know how to implement higher order functions for array of custom objects.