Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Did not work while searching in [Fuseable] #40

Open
mahmoud-omara-goodsmart opened this issue Apr 4, 2020 · 1 comment
Open

Did not work while searching in [Fuseable] #40

mahmoud-omara-goodsmart opened this issue Apr 4, 2020 · 1 comment

Comments

@mahmoud-omara-goodsmart
Copy link

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() }

@jeffreykuiken
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants