---
title: "contacts(with:)"
framework: contacts
role: symbol
role_heading: Type Method
path: "contacts/cncontactvcardserialization/contacts(with:)"
---

# contacts(with:)

Returns the contacts from the vCard data.

## Declaration

```swift
class func contacts(with data: Data) throws -> [CNContact]
```

## Parameters

- `data`: The vCard data representing one or more contacts.

## Return Value

Return Value An array of contacts. Discussion note: In Swift, this method returns a nonoptional result and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.
