- (void)filter:(UITextField *)textField
{
if ([textField.text length] == 0) {
self.fontsArray = _data;
[self.tableView reloadData];// insert delete
return;
}
NSString *regex = [NSString stringWithFormat:@"SELF LIKE[c]'%@*'", textField.text];
NSPredicate *predicate = [NSPredicate predicateWithFormat:regex];
self.fontsArray = [_data filteredArrayUsingPredicate:predicate];
[self.tableView reloadData];
}