Вопрос

I'm setting up twitter on iOS6 in an app. The problem I've stumbled upon is if: the user has multiple twitter accounts how do I choose which one to share to?

I've managed to get all the accounts in an array. But the question is how do I link this account:

 ACAccount *acct = [_accounts objectAtIndex:twitterAccountInt];

With this:

slComposerSheetController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
NSString *postText = [informationToBeShared objectForKey:@"postText"];
NSURL *postImageURL = [NSURL URLWithString:[informationToBeShared objectForKey:@"postImageURL"]];
NSURL *postURL = [NSURL URLWithString:[informationToBeShared objectForKey:@"postURL"]];

[slComposerSheetController setInitialText:[informationToBeShared objectForKey:@"postText"]];
[slComposerSheetController addImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:postImageURL]]];
[slComposerSheetController addURL:postURL];
[delegate presentViewController:slComposerSheetController animated:YES completion:nil];
Это было полезно?

Решение

If a user adds more twitter accounts in settings, the operating system adds an option over the SLComposeViewController where the user can choose which account he wants to tweet from.

It required no changes from me.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top