Twitter post with cocos2d 2.x
Here is what i am using for tweets:
You need the twitter.framework and
#import <Twitter/Twitter.h>
-(void) postTweet { AppController * app = (((AppController*) [UIApplication sharedApplication].delegate)); TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init]; [tweetViewController setInitialText:@"blablabalbalblabla"]; [tweetViewController setCompletionHandler: ^(TWTweetComposeViewControllerResult result) { dispatch_async(dispatch_get_main_queue(), ^{ { if (result == TWTweetComposeViewControllerResultDone) { //success } else if(result == TWTweetComposeViewControllerResultCancelled) { //cancelled } } [app.navController dismissModalViewControllerAnimated:YES]; }); }]; [app.navController presentModalViewController:tweetViewController animated:YES]; }
Recent Comments