When I move from GameScene(SKScene) to the Market(UIViewController) and back , the FPS decreases. Can you please say Why? , and where is the problem? The MarketView is the Empty and there is no evidence, only a transition which is carried out through the protocol (SKScne), which binds GameScene and GameViewController. Code:
//GameScene
import SpriteKit
protocol GameDelegate {
func Market()
func Question()
}
...
func returnToMarket(){
self.viewController.Market()
}
// GameViewController
class GameViewController: UIViewController , GameDelegate{
func Market() {
let storyBoard : UIStoryboard = UIStoryboard(name: "Market", bundle: nil)
let vc : UIViewController = storyBoard.instantiateViewControllerWithIdentifier("Market")
self.presentViewController(vc, animated: true, completion: nil)
}
...
}
// Market(UIViewController)
func ReturnToMainMeny() {
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vc : UIViewController = storyBoard.instantiateViewControllerWithIdentifier("GameViewController")
self.presentViewController(vc, animated: true, completion: nil)
}