---
title: "init(username:service:)"
framework: contacts
role: symbol
role_heading: Initializer
path: "contacts/cninstantmessageaddress/init(username:service:)"
---

# init(username:service:)

Returns a CNInstantMessageAddress object initialized with the specified user name and service.

## Declaration

```swift
init(username: String, service: String)
```

## Parameters

- `username`: The user name with which to initialize the doc://com.apple.contacts/documentation/Contacts/CNInstantMessageAddress object.
- `service`: The service with which to Initialize the doc://com.apple.contacts/documentation/Contacts/CNInstantMessageAddress object.

## Return Value

Return Value The initialized CNInstantMessageAddress object with the specified user name and service. Discussion User name and service are required to initialize CNInstantMessageAddress object.
