I will be sending out an update to my app with a new data structure, therefore if a user is updating my app I need to update their current data. So I was wondering how can I programatically tell if the user updated my app or installed a new copy (if a new copy is installed I don’t need to update anything) ?
Share
That depends on the kind of data structure you’re using.
In general, I would advise you against relying on checking your application version: a user using 2.0 might have just upgraded or it might be a new user.
I’d rather check if there’s a data structure already, and act accordingly. Assuming that you’re using a Sqlite-backed Core Data storage, you can either check whether the .sqlite file exists, or check if there are objects in your storage.