So I have a searchBar that works when you type in part of the name of a player or players and filters them but when you delete a character or more in the searchbar it does not show anything, I need help trying to add that as a condition in my func.
Code Block func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { if searchText == "" { parseJson() } else if searchText != "" { cPlayerArr = cPlayerArr.filter({ (player) -> Bool in return player.yahooName.lowercased().contains(searchText.lowercased()) }) } collections.reloadData() }