The error message is received on the second last line of the SelectProductsView
// Filter & Sort initialisation
init(sortOrder: ProductSortOrder2, filterString: String) {
let sortDescriptors: [SortDescriptor] = switch sortOrder {
case .name:
[SortDescriptor(\Product.name)]
}
let predicate = #Predicate { product in
product.name.localizedStandardContains(filterString)
|| filterString.isEmpty
}
_products = Query(filter: predicate, sort: sortDescriptors)
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: