Did not work while searching in [Fuseable]
Here is my implementation. it always succeeds while checking if !item.responds(to: Selector(property.name))
extension Member: Fuseable { var properties: [FuseProperty] { return [ FuseProperty(name: name ?? ""), FuseProperty(name: phone ?? "") ] } }
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { guard searchText.count > 0 else { self.displayedMembers = self.allMembers self.membersTableView.reloadData() return } self.displayedMembers = searchEngine.search(searchText, in: self.allMembers).map { self.allMembers[$0.index] } self.membersTableView.reloadData() }
I ran into the same problem, but after diving into it, it turned out I was using an old version of the package.
Fuseable support for structs was added after the latest release of the package (which is a while ago), see #20. Therefore, downloading only the most recent release (something package managers including Carthage do automatically) does not include this functionality (and the readme of the master is not in sync with what you're using).
I fixed it by pointing Carthage to the most recent commit:
github "krisk/fuse-swift" "c7adb16"
That fixed the problem for me. I hope it does so for you too!
@krisk Any reason why there hasn't been a release in a while?