cloudkit Determine if private database is available


completionHandlerA block that has no return value and takes the following parameters:
accountStatusThe status of the current user’s iCloud account.
errorAn error object or nil if the status is determined successfully. Use the information in the error object to determine whether the problem has a workaround.


Account status returned can be: couldNotDetermine, available, restricted or noAccount.

The status can change while the app is running, use the NSUbiquityIdentityDidChangeNotification to detect account changes and call this method again to retrieve the status for the new account.