Currently I have a crash when reading phone No. with empty label:
fatal error: unexpectedly found nil while unwrapping an Optional value
if let phones: ABMultiValueRef = ABRecordCopyValue(person,
kABPersonPhoneProperty)?.takeRetainedValue(){
for counter in 0..<ABMultiValueGetCount(phones){
let label = ABMultiValueCopyLabelAtIndex(phones,
counter).takeRetainedValue() as String
let phone = ABMultiValueCopyValueAtIndex(phones,
counter).takeRetainedValue() as! String
}
}
I tried to read label as:
let label = ABMultiValueCopyLabelAtIndex(phones,
counter).takeRetainedValue() as? String ?? ""
but result is the same.