Reputation: 6049
I am working on an application that is socially-based. It mainly deals with creating schedules for a specific activity and inviting other users to join on a specific date and time. However, the application is using Parse as its backend. Almost every action taken requires some networking, and it can feel slow on a low-quality connection.
How can I make the application seem more responsive?
NSCache
?I see that applications such as Facebook and Instagram present a few posts when the applications are launched while they go fetch the latest data, but I'm not sure as to how they accomplish this.
Can you provide me with an appropriate direction to take?
Upvotes: 0
Views: 76
Reputation: 70956
Keeping some kind of offline cache is useful, since it means you'll have some data to display immediately even if you're still loading new data from a network connection. Core Data can be useful for this, but it really depends on the nature of the data and on how your app uses it. NSCache
probably isn't what you want, since it only keeps data in memory and doesn't save it for the next time your app runs.
Apps that need frequent network updates (like Facebook) commonly make use of iOS's background fetch system. If you opt in to this, iOS will launch your app in the background from time to time to allow it to get new data. If your app saves that data somewhere on the device, it's already present when the user taps your app icon.
Using background fetch is pretty easy-- you add the appropriate key to Info.plist, and then implement application(application:, performFetchWithCompletionHandler:)
in your app delegate.
Upvotes: 1