ios - Action after tweet has been published -
i set button in game can tweet score. thing when user publishes tweet want open new view , don't know how know when tweet has been published. publish tweet used code:
-(void)sharetwitter { if ([slcomposeviewcontroller isavailableforservicetype:slservicetypetwitter]) { slcomposeviewcontroller *tweetsheet = [slcomposeviewcontroller composeviewcontrollerforservicetype:slservicetypetwitter]; [tweetsheet setinitialtext:[nsstring stringwithformat:@"i've scored 98 points!]; uiviewcontroller *controller = self.view.window.rootviewcontroller; [controller presentviewcontroller:tweetsheet animated:yes completion:nil]; }
}
you can set completion handler on tweetsheet so:
[tweetsheet setcompletionhandler:^(slcomposeviewcontrollerresult result) { switch (result) { case slcomposeviewcontrollerresultcancelled: nslog(@"post canceled"); break; case slcomposeviewcontrollerresultdone: nslog(@"post sucessful"); break; default: break; } }];
Comments
Post a Comment