SpriteKit SKView no longer transitions between scenes in iOS 9

We have a code base that was written and released in 2013, but in iOS 9 the app no ​​longer switches between SKScenewhen a message is presentScene:transition:sent to ours SKView. SKScenereceives a message didMoveToView:, but the scene itself is never displayed on the screen.

Here is what we tried:

  • Disabling MetalwithInfo.plist
  • Use [SKTransition transitionWithCIFilter:duration:]instead of predefined animations
  • Fine tuning zPosition
  • Transition to regular animations UIView(this led to the disappearance of ours SKNode)
  • Ensuring that the transition method is not called more than once
  • Explicitly set pausesOutgoingSceneto YESonSKTransition

None of the above attempts resolved the issue. Please note that everything goes correctly in iOS 8

Here is an example of code that does not work:

-(BOOL)presentTitle {
    if (!titleSceneLoaded) {
        return NO;
    }
    [skView presentScene:titleScene transition:[SKTransition fadeWithDuration:1.0]];
    return YES;
}

Changing it to this makes it work again (without transitions):

-(BOOL)presentTitle {
    if (!titleSceneLoaded) {
        return NO;
    }
    [skView presentScene:titleScene];
    return YES;
}

Any suggestions on how to find / fix / fix the error?

+4
source share
2 answers

We were not able to get SKTransitionto work. We talked to the development support team hosted on the developer forums and tried everything that was posted here.

SpriteKit iOS 9. - iOS 9, , UIView animateWithDuration:animations:completion:.

+1

iOS9 .

, , viewWillLayoutSubviews:

        [self.subview presentScene:self.scene];
        [self.view addSubview:self.subview];

:

        [((SKView *)self.view) presentScene:self.scene];

, , , .

+2

Source: https://habr.com/ru/post/1612492/


All Articles