I'm building an app that sends (every x seconds) to an API the location values with some extra values (session, ID, etc) that is working nice (see here Update CLLocation Manager on another method). But for improved feature, we are considering the device can lost (for some amount of time) internet connection. So I need to temporary store all values and when reconnected send them again to the API.
I'm considering several ways to do it:
- Core Data (difficult implementation)
- Realm (very little experience)
- NSDisctionary
Can anyone suggest (and show how, if possible) the best way to implement this feature?
Tadaaaaaa:
If you want to store a some of non-sensitive values (such as a password), I suggest to use NSUserDefaults, you can easily use it like a dictionary:
Note: Swift 2 Code.
For example: