Question

here i have a piece of code

(void)postToTwitter:(id)sender 
{

    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
    {
        SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
        [tweetSheet setInitialText:@"Great fun to learn iOS programming at softwareWeaver!"];
        [self presentViewController:tweetSheet animated:YES completion:nil];
    }

}

but what next to do ????

Was it helpful?

Solution

You can use the STTwitter library which makes all of this very very easy:

self.twitter = [STTwitterAPI twitterAPIOSWithFirstAccount];

[_twitter verifyCredentialsWithSuccessBlock:^(NSString *username) {

    [_twitter getFollowersForScreenName:username successBlock:^(NSArray *followers) {
        NSLog(@"-- %@", followers);
    } errorBlock:^(NSError *error) {
        //
    }];

} errorBlock:^(NSError *error) {
    //
}];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top