Skip to content

CNContactPickerViewController() constructor ​

The CNContactPickerViewController() constructor creates a contact picker.

Syntax ​

new CNContactPickerViewController()

Parameters ​

None.

Return value ​

A new CNContactPickerViewController. Each call returns a new object. It hasn't been presented yet (presentingViewController is null), and displayedPropertyKeys is null.

Each picker is used once. What happens if you present it a second time after using it is not verified; create a new one every time.

Exceptions ​

TypeError

Subclassing it and calling new: native classes can't be subclassed; see Native classes.

Examples ​

js
const picker = new CNContactPickerViewController();
console.log(picker instanceof UIViewController, picker.displayedPropertyKeys);

Result: Prints true null.

Corresponding iOS API ​

[[CNContactPickerViewController alloc] init].

See also ​