Am new to swift 2 and i got stuck in passing a variable from one class to another.
I have a class "GameScene" in it I have a public variable score and it keeps updating in update function. I want to send the score value at the time when two nodes collide with each other. Once it collides I go to another scene using "mainview .presentScene(gameoverScene)" syntax. I want the updated score in gameoverscene.
I tried using "private let _gameScene = GameScene()" in gameoverscene and passing it to a lable using "finalscore.text = String( _gameScene.finalScore)" the variable what I get is O which I declared at the beginning but not the updated score. Pls help me in finding out the solution.