APAddressBook icon indicating copy to clipboard operation
APAddressBook copied to clipboard

how to display contacts sorted alphabetically

Open techwizardg opened this issue 7 years ago • 1 comments

Not sure where to post and this is not a bug. In phone book we can have contacts stored with out name and inside the contact details we can have mobile number and email id. If the contact is stored with out name and has only email id we need to display the email id as name and if the contact is stored with multiple email ids and no name then the first email id to be displayed and if the contact is stored with mobile number and no name then the mobile number needs to be displayed. How to perform the same using this library?

techwizardg avatar Feb 06 '17 13:02 techwizardg

let name = contact.name?.compositeName ?? contact.emails?.first?.address ?? contact.phones?.first?.number ?? "Can't display name for this contact"

belkevich avatar Feb 07 '17 16:02 belkevich