Instance Method

requestAccessToAccounts(with:options:completion:)

Obtains permission to access protected user properties.

Declaration

func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!)

Parameters

accountType

The account type.

options

A dictionary of options, if options are required by the account type; otherwise, nil.

completion

The handler to call when the request has completed. The handler is called on an arbitrary queue.

Discussion

Certain account types (such as Facebook) require an options dictionary. This method will throw an NSInvalidArgumentException if the options dictionary is not provided for such account types. Conversely, if the account type does not require an options dictionary, the options parameter must be nil.

See Also

Requesting Access

typealias ACAccountStoreRequestAccessCompletionHandler

Specifies a handler to call when access is granted or denied.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software