I am opening the Twitter compose view on my app, but the screen takes too long to be displayed!
I started using the following code when the user taps 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 between 5 and 8 seconds to show the screen! For me it's too long, I saw apps that goes instantly. It is not an issue with my app, because I have created a new project with only this functionality, and it takes the same.
So I thought that the delay was in the moment that the screen is instantiated, so I have decided to declare my tweet screen on my header and moved this part to the viewDidAppear:
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
tweet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweet setInitialText:@"initial text "];
and on the button method is like that:
if(tweet)
[self presentViewController:tweet animated:YES completion:^
{
}];
but it didn't get faster. I am using an iPhone 4 and I have some apps that creates the twitter compose screen really fast, does anybody know how to do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…