ios - SLComposecontroller does not disable post button for long messages -
i used slcomposercontroller
, not disabling post button when character count exceeds 140 character . want post url ,image , initial text on twitter via ios application. how this?
it user set correct length send, think won't send if long, or give callback if didn't work.
here did:
-(void) postontwitterinsideview:(uiviewcontroller *)viewcontroller message:(nsstring *)postmessage{ if( [slcomposeviewcontroller isavailableforservicetype:slservicetypetwitter] ){ slcomposeviewcontroller *twitterpost = [slcomposeviewcontroller composeviewcontrollerforservicetype:slservicetypetwitter]; [twitterpost setcompletionhandler:^(slcomposeviewcontrollerresult result){ switch (result) { case slcomposeviewcontrollerresultdone: // tell user message sent break; case slcomposeviewcontrollerresultcancelled: // tell user message not sent break; default: break; } }]; [twitterpost addimage:self.imagepost]; [twitterpost setinitialtext:postmessage]; [viewcontroller presentviewcontroller:twitterpost animated:yes completion:nil]; } else { // tell user has activate service in settings of ios } }
Comments
Post a Comment