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 QEDReport instances to UserDefaults.

    Normally you will call this method when the app goes to background, passing your in memory model array for persisting.


    This method will also run clean up of local storage files keeping only those belonging to existing reports.



    public static func persist(reports: [QEDReport])



    An array of QEDReport instances representing your data model to be persisted locally to UserDefaults

  • Returns the locally persisted array of QEDReport instances.



    public static func loadFromStore() -> [QEDReport]

    Return Value

    Returns the currently persisted array of QEDReport instances from UserDefaults If no array is persisted currently in UserDefaults, an empty array will be returned.