Speed up app icon load time by 2 seconds by only waiting if it failed
This commit is contained in:
parent
46fe7a8aed
commit
6dbb938368
1 changed files with 3 additions and 1 deletions
|
|
@ -28,7 +28,9 @@ static const int MAX_ATTEMPTS = 5;
|
|||
appImage = [UIImage imageWithData:appAssetResp.data];
|
||||
self.app.image = UIImagePNGRepresentation(appImage);
|
||||
|
||||
[NSThread sleepForTimeInterval:RETRY_DELAY];
|
||||
if (![self isCancelled] && appImage == nil) {
|
||||
[NSThread sleepForTimeInterval:RETRY_DELAY];
|
||||
}
|
||||
}
|
||||
[self performSelectorOnMainThread:@selector(sendCallbackForApp:) withObject:self.app waitUntilDone:NO];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue