I open the tweet viewer in my application, but the screen takes too long to display!
I started using the following code when the user clicked the Twitter button:
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { SLComposeViewController *tweet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; [tweet setInitialText:@"initial text "]; [self presentViewController:tweet animated:YES completion:^ { }]; }
But it takes 5 to 8 seconds to display the screen! This is too long for me; I saw applications that go instantly. This is not a problem with my application, because I created a new project with only this functionality, and it accepts the same.
So, I thought that the delay was at the moment the screen was created, so I decided to declare my tweet screen on my header and moved this part to viewDidAppear:
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { tweet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; [tweet setInitialText:@"initial text "];
and by the button method:
if(tweet) [self presentViewController:tweet animated:YES completion:^ { }];
but he did not speed up. I use iPhone 4 and I have some applications that very quickly create a screen for creating twitter. Does anyone know how to do this?
source share