The below code works well to filter books by author but only works when search string is equal to full string. Example where authors contains full names [“Jack Nicklaus”, “Arnold Palmer”, “Sam Snead”]
How do I allow search bar to filter based on part of name and not case sensitive, example “Nicklaus”
if searchTextAuthor.isEmpty {
books
} else {
books.filter { $0.authors.contains(searchTextAuthor) }
}
}