Open ivanharmat opened 9 years ago
I have not had time to get this to work properly yet, but this repo provides all the base required, just needed integration into fxforms:
@wdcurry looks pretty good. I'll look into that. Thanks
I achieved this by implementing a custom view controller with FXFormFieldViewController that used UISearchController. I also had to do:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:NO];
if (self.searchController.isActive) {
Customer *selectedCustomer = [self.resultsFilteredTableController.filteredResults objectAtIndex: indexPath.row];
indexPath = [NSIndexPath indexPathForRow:[[Customer list] indexOfObject:selectedCustomer] inSection:0];
}
UITableViewCell<FXFormFieldCell> *cell = (UITableViewCell<FXFormFieldCell> *)[self.formController.tableView cellForRowAtIndexPath:indexPath];
if ([cell respondsToSelector:@selector(didSelectWithTableView:controller:)]) {
[cell didSelectWithTableView:tableView controller:self];
}
}
to get the selected row from the filtered results.
@billguy I'm going to try this solution, too. Thanks
I would like to build a search filter like this for your form helper:
It would be very useful for long lists, if you don't want to scroll down, you just type first 2-3 letters. I don't think this functionality is possible with the current version, although your form helper is very versatile. Could you point me in the right direction how to do this? I would just instantiate the search bar like so:
But it will have to be optional, bar tint color, placeholder, and other settings editable. I would create a pull request if this functionality is demanded by others. Thanks.