Skip to content
Use Levenshtein Distance values to sort list in a table search
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

LevenshteinDistance and Search

Levenshtein distance is a string metric for measuring the distance between two strings. In this demo project, Levenshtein distance is used to sort search results in a UIViewController with UITableViewDataSource context. The goal is to have the most relevant/closest match results shown at the top.

The LevenshteinDistance class is an Objective-C/C implementation of the code found here.

This project contains some example code using the LevenshteinDistance class in a UIViewController with a UITableViewDelegate, UITableViewDataSource, and UISearchDisplayController.

Run the project in Xcode 4 using the iOS Simulator to see how it works.

You can’t perform that action at this time.