RocketData icon indicating copy to clipboard operation
RocketData copied to clipboard

How to purge all items in the DataProvide and empty the cache in one shot?

Open rahimizad opened this issue 8 years ago • 1 comments

When a user logs out, we need to purge but it doesn't seem that you guys support a complete purge...

Is this the only way?

// Purge let count = self?.usersDataProvider.count ?? 0 for index in stride(from: count, to: 0, by: -1) { self?.usersDataProvider.remove(at: index) }

rahimizad avatar Feb 05 '17 21:02 rahimizad

In the LinkedIn app, when the user logs out we tear down all the view controllers. Since the data providers are owned by the view controller, they automatically get purged.

The easiest way to purge is to just create a new data provider.

plivesey avatar Feb 14 '17 18:02 plivesey