-
Notifications
You must be signed in to change notification settings - Fork 40
Example App
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:
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.
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.
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.
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.
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
.
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
.
Language: Swift
The statistics example generates statistics on contacts from the user's address book and displays them in a dialog.
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.
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
.