Filtering Array and displaying in Table View?
问题 I want to search an dictionary of exercises for the name key and then show the filtered result in the table view. I am using this function func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { let filtered = exercises.filter { $0["name"] == searchText } print(filtered) if(filtered.count == 0){ searchActive = false; } else { searchActive = true; } self.exercisesTableView.reloadData() } Variables: var exercises = [Exercise]() var filtered: [NSMutableArray] = [] var