Last active
August 29, 2015 14:13
-
-
Save ekurutepe/7994d725af6975f1d035 to your computer and use it in GitHub Desktop.
How to extract an email out of an ABRecord using Swift…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var unmanagedEmails = ABRecordCopyValue(person, property); | |
let emails: ABMultiValueRef = | |
Unmanaged.fromOpaque(unmanagedEmails.toOpaque()).takeUnretainedValue() as NSObject as ABMultiValueRef | |
let index = ABMultiValueGetIndexForIdentifier(emails, identifier) | |
var unmanagedEmail = ABMultiValueCopyValueAtIndex(emails, index); | |
let email: String = Unmanaged.fromOpaque(unmanagedEmail.toOpaque()).takeUnretainedValue() as NSObject as String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment