Contacts

Last updated on 8 Nov 2024.

Written by Jia Chen.

Swift Playgrounds for iPad app icon

Sample Project

Contacts

Last updated on 8 Nov 2024.

Written by Jia Chen.

Swift Playgrounds for iPad app icon

Sample Project

Contacts

Last updated on 8 Nov 2024.

Written by Jia Chen.

Swift Playgrounds for iPad app icon

Sample Project

Scroll Down

On this page

On this page

Getting Started

Permissions

In Xcode

  1. Open the top-most .xcodeproj file

  2. Navigate to the Info section

  3. Under Custom iOS Target Properties, create a new item

    Key: "Privacy - Contacts Usage Description"
    Value: Provide it with a descriptive reason on why you need access to the user's contacts

In Playgrounds

  1. Open the sidebar

  2. Select the App Settings item at the top of the sidebar

  3. Scroll down and select "Capabilities"

  4. Select +, search for "Contacts", and type in the reason you need access to the user's contacts

Selecting Contacts

To select contacts, whenever possible, use the Contact Access Button.

import ContactsUI

Contact Access Button

Contact Access Button allows you to search for the user's contacts in a privacy-preserving way that integrates seamlessly with your interface.

Presenting a Contact Access Picker

Fetching Contacts Information

Going Further

Contact Access Button Caption

Displaying Default Text

Displaying Phone Number

Displaying Email

Styling Contact Access Button

Retrieving Pieces of Contact Information

© 2024 Tinkertanker Pte Ltd / Swift Accelerator. All rights reserved.

© 2024 Tinkertanker Pte Ltd / Swift Accelerator. All rights reserved.

© 2024 Tinkertanker Pte Ltd / Swift Accelerator. All rights reserved.