Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Example App

Nick Entin edited this page Aug 7, 2016 · 1 revision

The Ohana example app contains various examples of how the framework can be used to load and process contacts. The examples are mixed between Swift and Objective-C. To run the example app, clone the repo, and run pod install from the Example directory, then open Ohana.xcworkspace and run the OhanaExample scheme. The following examples are available:

Basic Contact Picker

Language: Objective-C

The basic contact picker example displays a list of contacts from the user's address book and sorts them alphabetically by full name. Upon selecting a contact, a dialog is shown displaying which contact was selected.

Basic Contact Photos Picker

Language: Swift

The basic contact photos picker example displays a list of contacts from the user's address book and sorts them alphabetically by full name. The picker also displays the contact's thumbnail photo if it has one. Upon selecting a contact, a dialog is shown displaying which contact was selected.

Phone Number Picker

Language: Objective-C

The phone number picker example displays a list of contacts from the user's address book that have been split on their phone number fields and sorted alphabetically by full name. Upon selecting a contact, a dialog is shown displaying which phone number was selected.

Contact Selection

Language: Objective-C

The contact selection example displays a list of contacts from the user's address book that have been sorted alphabetically by full name. Tapping on a contact cell will toggle that contact's selection state. Tapping "SELECT ALL" in the top right will select all contacts, and tapping "DESELECT ALL" (when all contacts are selected) will deselect all contacts.

Fuzzy Search

Language: Objective-C

The fuzzy search example displays a list of contacts from the user's address book that have been sorted alphabetically by full name. Tapping on a contact cell will show a dialog displaying which contact was selected. Searching via the search bar will perform a fuzzy search on the contacts and display highlighted results showing which contacts were matched. Demonstrates use of OHFuzzyMatchingUtility.

Phone or Email Picker

Language: Swift

The phone or email picker example displays a list of contacts from the user's address book that have been split on their phone number and email address fields, and sorted alphabetically by full name. Upon selecting a contact, a dialog is shown displaying which phone number or email address was selected. Demonstrates use of OHCompositeOrPostProcessor.

Statistics

Language: Swift

The statistics example generates statistics on contacts from the user's address book and displays them in a dialog.

SMS Contact Picker

Language: Swift

The SMS contact picker example displays a list of contacts from the user's address book that have been split on their phone number fields and sorted alphabetically by full name. Upon selecting a contact, an SMS composer dialog is shown with a pre-filled message and the selected phone number set as the recipient. Note that this example must be run on a device with SMS capabilities for the composer to be shown.

Maximum Selected Count Picker

Language: Swift

The maximum selected count picker example displays a list of contacts from the user's address book that have been sorted alphabetically by full name. Tapping on a contact cell will toggle the selection state of that contact. The contact picker will allow the selection of a maximum of 3 contacts. Attempting to select more than 3 contacts will display a dialog alerting the user that the action is invalid. Demonstrates use of OHMaximumSelectedCountSelectionFilter.