I'm working on an app wich lists some music tracks from iTunes and I'm using SLComposeViewController to share the track Twitter with the album artwork in the tweet. It's working right now but when I click the share button it takes too much time to show me the "tweet interface" and the UI seems frozen.
I think it's because of the image loading but I don't know how to load it asynchronously. Because if I understand well, once I shown the SLComposeViewController I can't update it anymore...
This is the code I'm using :
NSString *textToShare = [[self.punchlinesArray objectAtIndex:[indexPath row]] objectForKey:@"quoteContent"];
NSString *imgUrlToShare = [[self.punchlinesArray objectAtIndex:[indexPath row]] objectForKey:@"artworkURL"];
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imgUrlToShare]]];
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeFacebook];
[tweetSheet setInitialText:textToShare];
[tweetSheet addImage:image];
Cheers,
Bastien