Created
January 3, 2017 21:29
-
-
Save spotlessicode/c5c6e59e915519587916ebb7e8e8f709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - ICLOUD | |
- (BOOL)iCloudAccountIsSignedIn { | |
if (debug==1) { | |
NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd)); | |
} | |
id token = [[NSFileManager defaultManager] ubiquityIdentityToken]; | |
if (token) { | |
NSLog(@"** iCloud is SIGNED IN with token '%@' **", token); | |
return YES; | |
} | |
return NO; | |
} | |
- (BOOL)iCloudEnabledByUser { | |
if (debug==1) { | |
NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd)); | |
} | |
[[NSUserDefaults standardUserDefaults] synchronize]; | |
if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"iCloudEnabled"] boolValue]) { | |
NSLog(@"** iCloud is ENABLED in Settings **"); | |
return YES; | |
} | |
NSLog(@"** iCloud is DISABLED in Settings **"); | |
return NO; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment