I am loading a selection scene for a player, however, when I tap the button which moves to that scene, it takes 4-5 seconds until it reveals the new scene.
In main menu I use:
SKTransition *transition = [SKTransition fadeWithDuration:0.1];
SKScene * scene = [[SelectionScene alloc] initWithSize:self.size];
[self.view presentScene:scene transition:transition];
And inside the SelectionScene I use:
- (id) initWithSize:(CGSize)size
{
if (self = [super initWithSize:size]) {
[self setupScene];
[self setupSelection];
}
return self;
}
As explained, it takes 4-5 seconds between the tap on the button until it moves to the next scene. Is there a way to setup the scene later so it first shows the next scene (I will display a loading screen) and load in background?
I have tried using :
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
//Background Thread
dispatch_async(dispatch_get_main_queue(), ^(void){
});
});
But it won't work.