Using this code, I tried to do an insensitive-case search to find companies for a certain major, but I get the error "Expression 'Bool' is ambiguous without more context" at let isFound =
.
Why? How do I solve this?
company.majors
is a String
array. searchValue
is a lowercase String
let searchValue = filterOptItem.searchValue?.lowercased()
for company in allCompanies {
//Insensitive case search
let isFound = company.majors.contains({ $0.caseInsensitiveCompare(searchValue) == ComparisonResult.orderedSame })
if (isFound) {
filteredCompanies.insert(company)
}
}