QEDModel
public struct QEDModel
QEDModel provides a set of helper methods to aid on persisting a data model ( represented as an array of QEDReport instances and its associated QEDFile instances).
Usage of QEDModel is optional and is meant just as an aid to speed up your data source implementation.
-
Will persist a given array of
QEDReportinstances toUserDefaults.Normally you will call this method when the app goes to background, passing your in memory model array for persisting.
Note
This method will also run clean up of local storage files keeping only those belonging to existing reports.Declaration
Swift
public static func persist(reports: [QEDReport])Parameters
reportsAn array of
QEDReportinstances representing your data model to be persisted locally toUserDefaults -
Returns the locally persisted array of
QEDReportinstances.Declaration
Swift
public static func loadFromStore() -> [QEDReport]Return Value
Returns the currently persisted array of
QEDReportinstances fromUserDefaultsIf no array is persisted currently inUserDefaults, an empty array will be returned.
QEDModel Structure Reference