---
title: "ColorSyncRegisterDevice(_:_:_:)"
framework: colorsync
role: symbol
role_heading: Function
platforms: [Mac Catalyst 13.0+, macOS 10.13+]
path: "colorsync/colorsyncregisterdevice(_:_:_:)"
---

# ColorSyncRegisterDevice(_:_:_:)

Registers a device of the given class with ColorSync.

## Declaration

```swift
func ColorSyncRegisterDevice(_ deviceClass: CFString!, _ deviceID: CFUUID!, _ deviceInfo: CFDictionary!) -> Bool
```

## Parameters

- `deviceClass`: The class of the device to register.
- `deviceID`: The identifier of the device to register.
- `deviceInfo`: A dictionary containing the information needed to register a device.

## Return Value

Return Value true on success and false in case of failure.

## Discussion

Discussion The deviceInfo dictionary requires the following keys: kColorSyncDeviceDescriptions: A CFDictionary with localized names of the device. Localization keys must be five-character strings containing a language code and region code in the lc_RG format, and must contain (at least) the en_US locale. kColorSyncFactoryProfiles: A CFDictionary of factory profile info dictionaries. The keys are the profile IDs and the values are the profile info dictionaries. It may also include the following optional keys: kColorSyncDeviceHostScope: The host scope of the device; one of kCFPreferencesCurrentHost or kCFPreferencesAnyHost. If you don’t specify it, the framework assumes kCFPreferencesCurrentHost. kColorSyncDeviceUserScope: The user scope of the device; one of kCFPreferencesCurrentUser or kCFPreferencesAnyUser. If you don’t specify it, the framework assumes kCFPreferencesCurrentUser. The factory profiles dictionary (the value for the key kColorSyncFactoryProfiles in deviceInfo) requires the following keys and values. A ProfileID (of CFStringRef type) identifies each profile and serves as the key. The value associated with the key is a profile info dictionary that describes an individual device profile. kColorSyncDeviceDefaultProfileID: The associated value must be one of the ProfileIDs present in the dictionary. Presence of this key is not required if there is only one factory profile. Each profile info CFDictionary requires the following keys: kColorSyncDeviceProfileURL: The CFURLRef of the profile to register. kColorSyncDeviceModeDescriptions: A CFDictionary with localized device mode names for the profile. Localization keys must be five-character strings containing a language code and region code in the lc_RG format, and must contain (at least) the en_US locale. For example, en_US “Glossy Paper with best quality”. Example of a deviceInfo dictionary: <<     kColorSyncDeviceDescriptions   <<                                         en_US  My Little Printer                                         de_DE  Mein Kleiner Drucker                                         fr_FR  Mon petit immprimeur                                         ...                                     >>     kColorSyncFactoryProfiles       <<                                         CFSTR("Profile 1")  <<                                                                 kColorSyncDeviceProfileURL    {CFURLRef}

kColorSyncDeviceModeDescriptions    <<                                                                                                         en_US Glossy Paper                                                                                                         de_DE Glanzpapier                                                                                                         fr_FR Papier glace                                                                                                         ...                                                                                                     >>                                         ...

kColorSyncDeviceDefaultProfileID  CFSTR("Profile 1")                                     >>     kColorSyncDeviceUserScope   kCFPreferencesAnyUser

kColorSyncDeviceHostScope   kCFPreferencesCurrentHost << note: Scope for factory profiles is exactly the same as the device scope. note: Pass kCFNull in lieu of the profile URL, or no URL key/value pair at all, if a factory profile is not available. This enables setting a custom profile. note: For compatibility with the legacy API, create the profile keys as CFStrings from uint32_t numbers as follows: CFStringRef key = CFStringCreateWithFormat(NULL, NULL, CFSTR("%u"), (uint32_t) i);

## See Also

### Registering and enumerating devices

- [ColorSyncDeviceCopyDeviceInfo(_:_:)](colorsync/colorsyncdevicecopydeviceinfo(_:_:).md)
- [ColorSyncDeviceProfileIterateCallback](colorsync/colorsyncdeviceprofileiteratecallback.md)
- [ColorSyncDeviceSetCustomProfiles(_:_:_:)](colorsync/colorsyncdevicesetcustomprofiles(_:_:_:).md)
- [ColorSyncIterateDeviceProfiles(_:_:)](colorsync/colorsynciteratedeviceprofiles(_:_:).md)
- [ColorSyncProfileCreateDeviceProfile(_:_:_:)](colorsync/colorsyncprofilecreatedeviceprofile(_:_:_:).md)
- [ColorSyncUnregisterDevice(_:_:)](colorsync/colorsyncunregisterdevice(_:_:).md)
