I am making a game with 50+ levels. I can\'t seem to be able to save the game so that when the user later opens the game, it will be on the same level they the user left off at.
You may want to use UserDefaults.
So, for example, in your AppDelegate
you would implement this:
func applicationDidEnterBackground(_ application: UIApplication) {
UserDefaults.standard.set("level_file_path", forKey: "currentLevel")
}
func applicationDidBecomeActive(_ application: UIApplication) {
let levelFilePath = UserDefaults.standard.string(forKey: "currentLevel")
// load your file/level here
}