Eureka
Eureka copied to clipboard
SearchBar in "MultipleSelectorViewController" and "SelectorViewController"
It could be really useful to have the possibility to display a search bar in the given view controllers in order for the user to filter its content.
I give you an example. I have to let the user select a country, and the languages he speaks. I let you imagine his pain when he has to scroll over all the countries and languages, without being able to simply type the first letters of the desired country, or language.
Maybe I missed it, but I didn't found anything yet in the Eureka project about it.
Anyway, i've done my own extension of your views, works like a charm ;)
Hey @YSDC I would be a great feature. How did you implement it?
In terms of feature usage I believe it can be set up from row.onPresent
callback. You might have changed MultipleSelectorViewController
and SelectorViewController
to add filter support.. right?
Exactly. I have create a FilterPushRow
and FilterMultiplePushRow
with both their own controller. I have reuse as much as i can what exist in Eureka, but modified enough to let the user define it's own type and support filter. If you are interested i can share them with you.
I have also create a new Row with a dictionary<String,Set<T>> as value to handle Sections :-)
@YSDC Could you please share the code, eventually we can merge it.
I would have prefered some customization on PushRow
and MultiplePushRow
rather than creating brand new rows. What do you think?
Yes, sounds better.
I will fork the code, create a branch an do a pull request.
With luck, i could do it before the end of the week (bank holiday in Switzerland :smile: )
sounds great! Hopefully we merge this feature soon!
@YSDC I am currently looking into doing this as well. Would you mind sharing the new code you used to accomplish this with a sample? It would be greatly appreciated; thank you!
+1
Any update on this? Would be useful in my project!
I implemented a search bar controller into SelectorViewController. However, due to the slow performance of evaluateHidden() I modified the code slightly to essentially destroy the form and re-create it using the filtered row options. This is obviously much faster than setting each row's hidden property, although I wonder if setting the hidden property equal to a function that evaluates whether the row should be hidden (by comparing against a simple array) would be faster. I'll give this a try later on and report back. If anyone else has any other suggestions, please feel free to share. :)
+1, it would be a really useful feature!
I shared my implementation of a Searchable PushRow here, since the controller is implemented from scratch and is not descendant from FormViewController
is far more performant than recreating the whole form, section and items everytime the user types a query in the search box via updateSearchResultsForSearchController
.
@bithavoc Any chance you could provide an example of your SearchablePushRow updated for Swift 3?
@mikaoj this is all I have for now, I'm going through the migration myself so I still need to add a few tweaks. Check it out: https://gist.github.com/bithavoc/f5c9d06f024bfb5d9d3bd9452b94849f
The main problem is PushRow uses PresentationMode
which only works with UIViewController and I need to use UITableViewController for the search bar so I had to implement my own row but I think it might be a good starting point.
Did anyone manage to implement a searchable multipleselector row?
@magicmikek yes, it's all in the gist.
@bithavoc You said above that a searchable multipleSelectorRow implementation is in the gist. I don't see anything related to multi-select in your gist above: https://gist.github.com/bithavoc/f5c9d06f024bfb5d9d3bd9452b94849f
Is there something newer? Great work on this. The replacement for PushRow is excellent.
@jkgz I misread the requirement, you're right, no multipleSelectorRow
here, just an efficient search capability. sorry @magicmikek 🙏
Any update ?
+1 on this idea. I am looking for a way to get a search bar on my Push Row. Any updates on this feature? Would be nice to have a customization on Push Row instead of having to implement another row type.
@bithavoc Thanks for creating a gist for the searchable Eureka view controller row. Do you have an example on how to use it? Edit: figured it out on my own (this is just a starter point):
<<< ComposableSearchablePushRow<Company>("Test") { row in
}
class Company: NSObject, SearchableItem {
func matchesSearchQuery(_ query: String) -> Bool {
return true
}
}
So, no SearchController inside Eureka for now ?
+1
@YSDC Is it possible to share the sample code for FilterPushRow and FilterMultiplePushRow using swift 4.2 or above ?
Any progress on FilterMultiplePushRow?