Delay when disconnecting viewController on iOS 9

This is for my quick version of the sprite . This was normal on iOS 8 , but I noticed this delay after I started launching the game on an iOS 9 device . Before my game returns to the game scene from the menu or any other presentation that was presented, there is one to two seconds of delay after pressing the dismissal button in one of these types.

I reject views with this code:

self.dismissViewControllerAnimated(true, completion: nil)

To solve this problem, I tried to run the code inside the main send queue. It did not help.

dispatch_async(dispatch_get_main_queue()) {
     self.dismissViewControllerAnimated(true, completion: nil)
}

Checked if there is anything in the game where methods are loaded that can cause a delay, but look good. In any case, the code has no problems in iOS 8.

Has anyone had a similar problem and maybe fixed it?

EDIT : I realized that the game scene is already starting to play and by the time my presentation is rejected, I can see that the animation is already playing. Example: A 3 second animation is already completed in the middle.

EDIT 2 . This issue does not occur on iOS 9 with iPhone 4, but it does happen with later versions, in my case with iPhone 6. This may be a new Metal rendering causing this. 4s does not have metal. The new iOS patch also did not receive this patch.

3 SKView. UIControlView SKView, UIView, UIControlView SKScene. , , SKView . , . iOS 9.2, Xcode 7.2.

+4
2

, , , - . ( SpriteKit - MenuViewController, ViewController SKView), :

ViewController ( , ..), modalPresentationStyle .OverFullScreen.

, ( Apple View Controller iOS):

UIModalPresentationFullScreen style, UIKit . , UIModalPresentationOverFullScreen. , .

, , SKView

+5

. .

Xcode. ViewController pushViewController(). 2-3 .

ViewController . Interface Builder.

. . , .

0

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


All Articles