What's the most memory efficient way to update a table with data, iOS, Swift 3?

What is the most memory / battery efficient approach for an application displaying a table view using meetings? Meetings can end up being updated at any time by a third party (there is no way to get notified of this, it just collects meetings from its own iOS calendar):

  • Refresh the screen periodically (thus restoring the same number of cells that are present on the screen, maximum 5-6 cells).

  • Fetch meetings in the background and compare objects against the equivalent protocol (the Meeting object has references to other objects, which in turn are their own objects, and each level needs to be compared to make sure the two objects are equal) and only if the object has changed. reload the table with data?

+3


source to share


1 answer


Have you looked into observing external changes in the calendar database? From Apple docs:

The EKEventStore object publishes an EKEventStoreChangedNotification whenever a change is detected in the calendar database. Register for this notification if your app is handling an event or data reminder.



What I'm going to start --- should be a much better way than "refresh" every minute ...

ref: https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/EventKitProgGuide/ObservingChanges/ObservingChanges.html#//apple_ref/doc/uid/TP40009765-CH4-SW1

+3


source







All Articles