Skip to content

STRUCT

CoreDataModel

Contents

swift
public struct CoreDataModel: Codable, Equatable

A Core Data model.

Properties

path

swift
public var path: FilePath

Path to the model.

versions

swift
public var versions: [FilePath]

Paths to the versions.

currentVersion

swift
public var currentVersion: String?

Optional Current version (with or without extension)

Methods

init(_:versions:currentVersion:)

swift
public init(
    _ path: FilePath,
    versions: [FilePath] = [],
    currentVersion: String? = nil
)

Creates a Core Data model from a path.

  • Parameters:
    • path: path to the Core Data model.
    • versions: optional array of paths to each versioned .xcdatamodel file. Will be filled automatically by default.
    • currentVersion: optional current version name (with or without the extension) By providing nil, it will try to read it from the .xccurrentversion file.

Parameters

NameDescription
pathpath to the Core Data model.
versionsoptional array of paths to each versioned .xcdatamodel file. Will be filled automatically by default.
currentVersionoptional current version name (with or without the extension) By providing nil, it will try to read it from the .xccurrentversion file.