implement SLComposeViewController into Cocos2d -
i can't seem slcomposeviewcontroller come button on cocos2d layer. if see stop working please tell. appreciated: n.b. viewcontroller uiviewcontroller
-(void)sceneselect { nsstring *message = [nsstring stringwithformat:@"twitter message"]; nsstring *servicetype = [nsstring stringwithformat:@"slservicetypetwitter"]; if ([slcomposeviewcontroller isavailableforservicetype:servicetype]) { slcomposeviewcontroller *tweetcontroller = [slcomposeviewcontroller composeviewcontrollerforservicetype:servicetype]; [tweetcontroller setinitialtext:message]; tweetcontroller.completionhandler = ^(slcomposeviewcontrollerresult result){ if (result == slcomposeviewcontrollerresultdone){ //nslog call } else if (result == slcomposeviewcontrollerresultcancelled){ //nslog call } [viewcontroller dismissviewcontrolleranimated: yes completion: nil]; }; [[[ccdirector shareddirector]openglview]addsubview:viewcontroller.view]; [viewcontroller presentviewcontroller:tweetcontroller animated:yes completion:nil]; } else { uialertview *alertview = [[uialertview alloc] initwithtitle:@"twitter" message:@"twitter not working" delegate:nil cancelbuttontitle:@"dismiss" otherbuttontitles:nil]; [alertview show]; } }
cocos2d 2.0 use navigation controller in appdelegate
appcontroller *app = (appcontroller*) [[uiapplication sharedapplication] delegate]; [[app navcontroller] presentmodalviewcontroller:tweetcontroller animated:yes];
here full twitter code: http://pastebin.com/hprrjm1n