fuse-swift alternatives and similar libraries
Based on the "Text" category.
Alternatively, view fuse-swift alternatives based on common mentions on social networks and blogs.
-
PhoneNumberKit
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. -
ZSSRichTextEditor
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view -
Twitter Text Obj
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform. -
FontAwesomeKit
Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons. -
TwitterTextEditor
A standalone, flexible API that provides a full-featured rich text editor for iOS applications. -
RichEditorView
DISCONTINUED. RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. -
SwiftyMarkdown
Converts Markdown files and strings into NSAttributedStrings with lots of customisation options. -
Atributika
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement. -
SwiftIconFont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon) -
NSStringEmojize
A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters -
Mustard
🌭 Mustard is a Swift library for tokenizing strings when splitting by whitespace doesn't cut it. -
Heimdall
Heimdall is a wrapper around the Security framework for simple encryption/decryption operations. -
AttributedTextView
Easiest way to create an attributed UITextView (with support for multiple links and from html)
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of fuse-swift or a related project?
README
Fuse
What is Fuse?
Fuse is a super lightweight library which provides a simple way to do fuzzy searching.
Usage
Example 1
let fuse = Fuse()
let result = fuse.search("od mn war", in: "Old Man's War")
print(result?.score) // 0.44444444444444442
print(result?.ranges) // [CountableClosedRange(0...0), CountableClosedRange(2...6), CountableClosedRange(9...12)]
Example 2
Search for a text pattern in an array of srings.
let books = ["The Silmarillion", "The Lock Artist", "The Lost Symbol"]
let fuse = Fuse()
// Improve performance by creating the pattern once
let pattern = fuse.createPattern(from: "Te silm")
// Search for the pattern in every book
books.forEach {
let result = fuse.search(pattern, in: $0)
print(result?.score)
print(result?.ranges)
}
Example 3
class Book: Fuseable {
dynamic var name: String
dynamic var author: String
var properties: [FuseProperty] {
return [
FuseProperty(name: "title", weight: 0.3),
FuseProperty(name: "author", weight: 0.7),
]
}
}
let books: [Book] = [
Book(author: "John X", title: "Old Man's War fiction"),
Book(author: "P.D. Mans", title: "Right Ho Jeeves")
]
let fuse = Fuse()
let results = fuse.search("man", in: books)
results.forEach { item in
print("index: " + item.index)
print("score: " + item.score)
print("results: " + item.results)
print("---------------")
}
// Output:
//
// index: 1
// score: 0.015
// results: [(key: "author", score: 0.015000000000000003, ranges: [CountableClosedRange(5...7)])]
// ---------------
// index: 0
// score: 0.028
// results: [(key: "title", score: 0.027999999999999997, ranges: [CountableClosedRange(4...6)])]
Example 4
let fuse = Fuse()
fuse.search("Man", in: books, completion: { results in
print(results)
})
Options
Fuse
takes the following options:
location
: Approximately where in the text is the pattern expected to be found. Defaults to0
distance
: Determines how close the match must be to the fuzzylocation
(specified above). An exact letter match which isdistance
characters away from the fuzzy location would score as a complete mismatch. A distance of0
requires the match be at the exactlocation
specified, adistance
of1000
would require a perfect match to be within800
characters of the fuzzy location to be found using a 0.8 threshold. Defaults to100
threshold
: At what point does the match algorithm give up. A threshold of0.0
requires a perfect match (of both letters and location), a threshold of1.0
would match anything. Defaults to0.6
maxPatternLength
: The maximum valid pattern length. The longer the pattern, the more intensive the search operation will be. If the pattern exceeds themaxPatternLength
, thesearch
operation will returnnil
. Why is this important? Read this. Defaults to32
isCaseSensitive
: Indicates whether comparisons should be case sensitive. Defaults tofalse
Example Project
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
Fuse is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Fuse"
License
Fuse is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the fuse-swift README section above
are relevant to that project's source code only.