Here is the sentence from Apple Docs: "If iCloud is not configured, ask users if they want to configure it (and, preferably, transfer them to Launch Settings if they want to configure iCloud)."
How can I check if iCloud is configured or not and how to launch settings for iCloud?
Just to supplement the answer above, if you only want to know if iCloud is available for your application, e.g.
1. no iCloud account is setup, or
2. Documents and Data is disabled (for all apps), or
3. Documents and Data is disabled for your app only
then you can use
NSFileManager's ubiquityIdentityToken
for iOS 6 and above.If value is nil, then iCloud account is not configured. Otherwise, iCloud account is configured.
Note that according to Apple docs, you can call it from the main thread.
Edit:
If you are targeting iOS6 or above you can use
[[NSFileManager defaultManager] ubiquityIdentityToken];
. For usage example please refer @Dj S' answer :).It is faster and easier than the original solution which was meant for people targeting iOS5 and above
Original Answer
As documented in iOS App programming guide - iCloud Storage. That can be checked by asking the ubiquity container URL to the file manager :)
As long as you supply a valid ubiquity container identifier below method should return YES
However, I've found that
URLForUbiquityContainerIdentifier:
might take several seconds the very first time within a session (I used it in iOS5 so things might be different now). I remember using something like this: