I am creating an iPhone app using swift 4 and I would like to add a pause menu but I do not know what commands I should use to make everything stop. I have some timers with which I increase the score and create random elements, I had thought I could stop them, is that the best option?
let timer1 = Timer.scheduledTimer(timeInterval: TimeInterval(itemController.randomNumbers(firstNum: 0.5, secondNum: 1)), target: self, selector: #selector (GamePlaySceneClass.spawnItems), userInfo: nil, repeats: true)
timer1.fire()
The objects are affected by gravity, so I suppose it would have to be stopped during the pause. After leaving the pause menu everything should continue as it was
Thank you very much.