PersistenceService

class PersistenceService

Initialises a persistent store and provides functions to allow ModelController to add objects to it’s context and save that context.

  • Init for PersistenceService class

    Declaration

    Swift

    private init()
  • Initialises a space for groups of related model objects that represent a view of a persistent store. Changes are held in memory in the context until saved to a persistent store

    Declaration

    Swift

    static var context: NSManagedObjectContext { get }
  • The persistent container or store for the application

    Declaration

    Swift

    static var persistentContainer: NSPersistentContainer
  • Saves the context to a persistent store

    Declaration

    Swift

    static func saveContext()