Latest 0.1.1
License MIT
Platforms ios 8.0

Locally searching in Swift made simple (and fuzzily).


Fuzzi allows you to search efficiently through a lot of data.
It uses BK-Tree’s as well as a weigthed size based score with the Levenshtein distance of strings to find the correct results and sort them accordingly.


Fuzzi is available on Cocoapods. (at least soon)
Simply add the following to your podfile:

pod 'Fuzzi'


Start by defining what you want to search. Let it implement the protocol Searchable.
This will require it your data to be both Hashable, Equatable and Codable as well as provide the strings by which the data should be searched.

Like say:

struct Repo {
  let name: String
  let description: String
  let link: URL

extension Repo: Searchable {

  var hashValue: Int {
    return name.hashValue ^ description.hashValue ^ link.hashValue

  static func == (lhs: Repo, rhs: Repo) -> Bool {
    return == && 
      lhs.description == rhs.description && ==

  var searchableProperties: [KeyPath<Repo, String>] {
    return [


Then whenever you have a collection of these objects simply use .tree() to create a searchTree.

let tree = repos.tree() "Fzzi") // Should return the "Fuzzi" repo


PRs are welcome!

Latest podspec

    "name": "Fuzzi",
    "version": "0.1.1",
    "summary": "Locally searching in Swift made simple (and fuzzily)",
    "description": "Locally searching in Swift made simple (and fuzzily)",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "mathiasquintero": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "social_media_url": "",
    "swift_version": "4.1",
    "platforms": {
        "ios": "8.0"
    "source_files": "Fuzzi/Classes/**/*"

Pin It on Pinterest

Share This