Skip to content

Instantly share code, notes, and snippets.

@gonzalezreal
Created November 3, 2012 14:23
Show Gist options
  • Save gonzalezreal/4007520 to your computer and use it in GitHub Desktop.
Save gonzalezreal/4007520 to your computer and use it in GitHub Desktop.
+ (ACAccountStore *)tgr_sharedAccountStore
{
static dispatch_once_t onceToken;
static ACAccountStore *accountStore;
dispatch_once(&onceToken, ^{
accountStore = [[ACAccountStore alloc] init];
});
return accountStore;
}
- (BOOL)tgr_twitterAccountAccessGranted
{
ACAccountType *twitterType = [self accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
return [twitterType accessGranted];
}
- (void)tgr_requestAccessToTwitterAccountsWithCompletionHandler:(void (^)(BOOL granted, NSError *error))completionHandler
{
ACAccountType *twitterType = [self accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[self requestAccessToAccountsWithType:twitterType
options:nil
completion:completionHandler];
}
- (NSArray *)tgr_twitterAccounts
{
ACAccountType *twitterType = [self accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
return [self accountsWithAccountType:twitterType];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment