The scene runs all the functions, but on older computers (like the 4S or 5C) it takes about 2 seconds for the nodes to appear (sometimes a little more or a little less).
I print:
print("antes")
//sprites y matrixSprites son SKSpriteNode
sprites.addChild(matrixSprites)
print("después")
Both are printed in the console print
, 2 seconds pass and the elements that are in the node are just shown on the screen sprites
. Is there a way to pre-load the scene and find out if all the elements are already visible in the scene, such as to make a "loading..." screen.
You can use SKActions to then use completion , let me explain in code:
The idea of this is to leave an action defined inside the "render" variable, this will be executed by the self.run method (SKScene.run) and once it is completely executed then it will execute the code statements that you define, in the case of the example a print("response")