Skip to content

Commit

Permalink
Fix search bar case-insensitive #273
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Dessus authored and Dimitri Dessus committed Aug 22, 2016
1 parent 0067fa9 commit 8819118
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions iPokeGo/PokemonSelectTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *

-(void)updateSearchResultsForSearchController:(UISearchController *)searchController
{
NSString *searchTerm = searchController.searchBar.text;
NSString *searchTerm = [searchController.searchBar.text lowercaseString];
if([searchTerm length] == 0) {
self.pokemonIDFiltered = [self.pokemonID mutableCopy];
} else {
NSMutableArray *searchResults = [[NSMutableArray alloc] init];

for(id pokemon in self.pokemonID) {
if([[self.localization objectForKey:[NSString stringWithFormat:@"%@", pokemon]] containsString:searchTerm]) {
if([[[self.localization objectForKey:[NSString stringWithFormat:@"%@", pokemon]] lowercaseString] containsString:searchTerm]) {
[searchResults addObject:pokemon];
}
}
Expand Down

0 comments on commit 8819118

Please sign in to comment.