From 62b11309f3ba37e649e9cc371a1901c26a1e68bb Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 18 Aug 2015 21:49:40 +0900 Subject: [PATCH] expose DataStack vars to CoreStore --- CoreStore/Setting Up/CoreStore+Setup.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CoreStore/Setting Up/CoreStore+Setup.swift b/CoreStore/Setting Up/CoreStore+Setup.swift index bd81e0b..11b42cf 100644 --- a/CoreStore/Setting Up/CoreStore+Setup.swift +++ b/CoreStore/Setting Up/CoreStore+Setup.swift @@ -32,6 +32,22 @@ import GCDKit public extension CoreStore { + /** + Returns the `defaultStack`'s model version. The version string is the same as the name of the version-specific .xcdatamodeld file. + */ + public static var modelVersion: String { + + return self.defaultStack.modelVersion + } + + /** + Returns the entity name-to-class type mapping from the `defaultStack`'s model. + */ + public static var entitiesByName: [String: NSManagedObject.Type] { + + return self.defaultStack.entitiesByName + } + /** Adds an in-memory store to the `defaultStack`.