How can I find a specific item from custom object in a huge array like bellow?
struct ResponseCourseTypeFilter {
var returnCourseTypeFilter: [[String : String]]
}
struct ViewModelCourseTypeFilter {
struct DisplayedCourseTypeFilter {
var titlesCourseType: String
var isSelectedType: Bool
}
var displayedCourseTypeFilter: [DisplayedCourseTypeFilter]
}
I need to get values titlesCourseType are true.
My array is huge.
CourseTypeFilterCourseTypeFilter.array.first(where: { $0. isSelectedType == true })this is if you need only one item, andarray.filter { $0. isSelectedType == true }for all of them. Google magictitlesCourseTypeis a string, did you mean the propertyisSelectedType? And do you want to filter the arraydisplayedCourseTypeFilteror some other array?array, thousands , or millions?