Closed scy0334 closed 2 years ago
Hi! Thanks for this amazing library.
I want to add a search functionality for Korean, but current search feature isn't compatible with Korean.
So I was wondering what if we add search feature customization for iOS DropDown as below.
iOS DropDown
Current
var searchText = String() { didSet{ if searchText == "" { self.dataArray = self.optionArray }else{ self.dataArray = optionArray.filter { return $0.range(of: searchText, options: .caseInsensitive) != nil } } reSizeTable() selectedIndex = nil self.table.reloadData() } }
My Suggestion
var searchText = String() { didSet{ if searchText == "" { self.dataArray = self.optionArray }else{ self.dataArray = optionArray.filter { return searchFilter(text: $0, searchText: searchText) } } reSizeTable() selectedIndex = nil self.table.reloadData() } } open func searchFilter(text: String, searchText: String) -> Bool { return text.range(of: searchText, options: .caseInsensitive) != nil }
In this way, I can subclass DropDown and customize the searchFilter as my own need.
DropDown
Thanks!
Thanks for your suggestions, i will update it
Hi! Thanks for this amazing library.
I want to add a search functionality for Korean, but current search feature isn't compatible with Korean.
So I was wondering what if we add search feature customization for
iOS DropDown
as below.Current
My Suggestion
In this way, I can subclass
DropDown
and customize the searchFilter as my own need.Thanks!