I write a game on the Swift. I want to do something like logins, you can choose the one you have already created, or create a new one. Settings must be saved for each such login separately. what is better to do? (now I do it through NSUserDefaults). And how best to organize it?

  • I think it's best to add a player id to the key string. For example, the key in NSUserDefaults of the KEVIN player’s best score would be “KEVIN_highScore”. - Yaroslav

1 answer 1

Player data is stored in a dictionary. The key for NSUserDefaults will be soap or user id. Also stored separately array of these (to preserve the order of users, if needed).