Renaming project because of cocoapods name clash with HardcoreData :(

This commit is contained in:
John Rommel Estropia
2015-05-27 22:51:02 +09:00
parent 1cc4f21336
commit 8361ba1b53
83 changed files with 847 additions and 502 deletions

View File

@@ -7,12 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
2F03A53619C5C6DA005002A5 /* HardcoreData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* HardcoreData.h */; settings = {ATTRIBUTES = (Public, ); }; };
2F03A54019C5C6DA005002A5 /* HardcoreDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F03A53F19C5C6DA005002A5 /* HardcoreDataTests.swift */; };
2F03A53619C5C6DA005002A5 /* CoreStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* CoreStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
2F03A54019C5C6DA005002A5 /* CoreStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F03A53F19C5C6DA005002A5 /* CoreStoreTests.swift */; };
2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F03A54C19C5C872005002A5 /* CoreData.framework */; };
2F291E2719C6D3CF007AF63F /* HardcoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F291E2619C6D3CF007AF63F /* HardcoreData.swift */; };
B504D0D61B02362500B2BBB1 /* HardcoreData+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B504D0D51B02362500B2BBB1 /* HardcoreData+Setup.swift */; };
B5D1E22C19FA9FBC003B2874 /* NSError+HardcoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* NSError+HardcoreData.swift */; };
2F291E2719C6D3CF007AF63F /* CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F291E2619C6D3CF007AF63F /* CoreStore.swift */; };
B504D0D61B02362500B2BBB1 /* CoreStore+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B504D0D51B02362500B2BBB1 /* CoreStore+Setup.swift */; };
B5D1E22C19FA9FBC003B2874 /* NSError+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* NSError+CoreStore.swift */; };
B5D372841A39CD6900F583D9 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B5D372821A39CD6900F583D9 /* Model.xcdatamodeld */; };
B5D372861A39CDDB00F583D9 /* TestEntity1.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D372851A39CDDB00F583D9 /* TestEntity1.swift */; };
B5D39A0219FD00C9000E91BB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5D39A0119FD00C9000E91BB /* Foundation.framework */; };
@@ -22,13 +22,13 @@
B5E84EDF1AFF84500064E85B /* DataStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EDB1AFF84500064E85B /* DataStack.swift */; };
B5E84EE11AFF84500064E85B /* PersistentStoreResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EDE1AFF84500064E85B /* PersistentStoreResult.swift */; };
B5E84EE61AFF84610064E85B /* DefaultLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE31AFF84610064E85B /* DefaultLogger.swift */; };
B5E84EE71AFF84610064E85B /* HardcoreData+Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE41AFF84610064E85B /* HardcoreData+Logging.swift */; };
B5E84EE81AFF84610064E85B /* HardcoreDataLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE51AFF84610064E85B /* HardcoreDataLogger.swift */; };
B5E84EE71AFF84610064E85B /* CoreStore+Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE41AFF84610064E85B /* CoreStore+Logging.swift */; };
B5E84EE81AFF84610064E85B /* CoreStoreLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE51AFF84610064E85B /* CoreStoreLogger.swift */; };
B5E84EF41AFF846E0064E85B /* AsynchronousDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEA1AFF846E0064E85B /* AsynchronousDataTransaction.swift */; };
B5E84EF51AFF846E0064E85B /* BaseDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEB1AFF846E0064E85B /* BaseDataTransaction.swift */; };
B5E84EF61AFF846E0064E85B /* DataStack+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */; };
B5E84EF71AFF846E0064E85B /* DetachedDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EED1AFF846E0064E85B /* DetachedDataTransaction.swift */; };
B5E84EF81AFF846E0064E85B /* HardcoreData+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEE1AFF846E0064E85B /* HardcoreData+Transaction.swift */; };
B5E84EF81AFF846E0064E85B /* CoreStore+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEE1AFF846E0064E85B /* CoreStore+Transaction.swift */; };
B5E84EFB1AFF846E0064E85B /* SaveResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EF21AFF846E0064E85B /* SaveResult.swift */; };
B5E84EFC1AFF846E0064E85B /* SynchronousDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EF31AFF846E0064E85B /* SynchronousDataTransaction.swift */; };
B5E84F0D1AFF847B0064E85B /* BaseDataTransaction+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EFE1AFF847B0064E85B /* BaseDataTransaction+Querying.swift */; };
@@ -39,9 +39,9 @@
B5E84F121AFF847B0064E85B /* OrderBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F041AFF847B0064E85B /* OrderBy.swift */; };
B5E84F131AFF847B0064E85B /* Where.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F051AFF847B0064E85B /* Where.swift */; };
B5E84F141AFF847B0064E85B /* DataStack+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F061AFF847B0064E85B /* DataStack+Querying.swift */; };
B5E84F151AFF847B0064E85B /* HardcoreData+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F071AFF847B0064E85B /* HardcoreData+Querying.swift */; };
B5E84F151AFF847B0064E85B /* CoreStore+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F071AFF847B0064E85B /* CoreStore+Querying.swift */; };
B5E84F201AFF84860064E85B /* DataStack+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1A1AFF84860064E85B /* DataStack+Observing.swift */; };
B5E84F211AFF84860064E85B /* HardcoreData+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1B1AFF84860064E85B /* HardcoreData+Observing.swift */; };
B5E84F211AFF84860064E85B /* CoreStore+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1B1AFF84860064E85B /* CoreStore+Observing.swift */; };
B5E84F221AFF84860064E85B /* ManagedObjectController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1C1AFF84860064E85B /* ManagedObjectController.swift */; };
B5E84F231AFF84860064E85B /* ManagedObjectListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1D1AFF84860064E85B /* ManagedObjectListController.swift */; };
B5E84F241AFF84860064E85B /* ManagedObjectListObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1E1AFF84860064E85B /* ManagedObjectListObserver.swift */; };
@@ -49,7 +49,7 @@
B5E84F281AFF84920064E85B /* NSManagedObject+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F271AFF84920064E85B /* NSManagedObject+Convenience.swift */; };
B5E84F2E1AFF849C0064E85B /* AssociatedObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2A1AFF849C0064E85B /* AssociatedObjects.swift */; };
B5E84F2F1AFF849C0064E85B /* NotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */; };
B5E84F301AFF849C0064E85B /* NSManagedObjectContext+HardcoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+HardcoreData.swift */; };
B5E84F301AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */; };
B5E84F311AFF849C0064E85B /* WeakObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2D1AFF849C0064E85B /* WeakObject.swift */; };
B5E84F361AFF85470064E85B /* NSManagedObjectContext+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */; };
B5E84F371AFF85470064E85B /* NSManagedObjectContext+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */; };
@@ -64,7 +64,7 @@
containerPortal = 2F03A52719C5C6DA005002A5 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2F03A52F19C5C6DA005002A5;
remoteInfo = HardcoreData;
remoteInfo = CoreStore;
};
B5D808011A34715700A44484 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
@@ -83,16 +83,16 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
2F03A53019C5C6DA005002A5 /* HardcoreData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HardcoreData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2F03A53019C5C6DA005002A5 /* CoreStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreStore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2F03A53419C5C6DA005002A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2F03A53519C5C6DA005002A5 /* HardcoreData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HardcoreData.h; sourceTree = "<group>"; };
2F03A53B19C5C6DA005002A5 /* HardcoreDataTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HardcoreDataTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2F03A53519C5C6DA005002A5 /* CoreStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreStore.h; sourceTree = "<group>"; };
2F03A53B19C5C6DA005002A5 /* CoreStoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreStoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2F03A53E19C5C6DA005002A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2F03A53F19C5C6DA005002A5 /* HardcoreDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = HardcoreDataTests.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
2F03A53F19C5C6DA005002A5 /* CoreStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CoreStoreTests.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
2F03A54C19C5C872005002A5 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
2F291E2619C6D3CF007AF63F /* HardcoreData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = HardcoreData.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
B504D0D51B02362500B2BBB1 /* HardcoreData+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Setup.swift"; sourceTree = "<group>"; };
B5D1E22B19FA9FBC003B2874 /* NSError+HardcoreData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSError+HardcoreData.swift"; sourceTree = "<group>"; };
2F291E2619C6D3CF007AF63F /* CoreStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CoreStore.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
B504D0D51B02362500B2BBB1 /* CoreStore+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreStore+Setup.swift"; sourceTree = "<group>"; };
B5D1E22B19FA9FBC003B2874 /* NSError+CoreStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSError+CoreStore.swift"; sourceTree = "<group>"; };
B5D372831A39CD6900F583D9 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
B5D372851A39CDDB00F583D9 /* TestEntity1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEntity1.swift; sourceTree = "<group>"; };
B5D39A0119FD00C9000E91BB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -104,13 +104,13 @@
B5E84EDB1AFF84500064E85B /* DataStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataStack.swift; sourceTree = "<group>"; };
B5E84EDE1AFF84500064E85B /* PersistentStoreResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersistentStoreResult.swift; sourceTree = "<group>"; };
B5E84EE31AFF84610064E85B /* DefaultLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultLogger.swift; sourceTree = "<group>"; };
B5E84EE41AFF84610064E85B /* HardcoreData+Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Logging.swift"; sourceTree = "<group>"; };
B5E84EE51AFF84610064E85B /* HardcoreDataLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HardcoreDataLogger.swift; sourceTree = "<group>"; };
B5E84EE41AFF84610064E85B /* CoreStore+Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreStore+Logging.swift"; sourceTree = "<group>"; };
B5E84EE51AFF84610064E85B /* CoreStoreLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreStoreLogger.swift; sourceTree = "<group>"; };
B5E84EEA1AFF846E0064E85B /* AsynchronousDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsynchronousDataTransaction.swift; sourceTree = "<group>"; };
B5E84EEB1AFF846E0064E85B /* BaseDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseDataTransaction.swift; sourceTree = "<group>"; };
B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Transaction.swift"; sourceTree = "<group>"; };
B5E84EED1AFF846E0064E85B /* DetachedDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetachedDataTransaction.swift; sourceTree = "<group>"; };
B5E84EEE1AFF846E0064E85B /* HardcoreData+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Transaction.swift"; sourceTree = "<group>"; };
B5E84EEE1AFF846E0064E85B /* CoreStore+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreStore+Transaction.swift"; sourceTree = "<group>"; };
B5E84EF21AFF846E0064E85B /* SaveResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SaveResult.swift; sourceTree = "<group>"; };
B5E84EF31AFF846E0064E85B /* SynchronousDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronousDataTransaction.swift; sourceTree = "<group>"; };
B5E84EFE1AFF847B0064E85B /* BaseDataTransaction+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BaseDataTransaction+Querying.swift"; sourceTree = "<group>"; };
@@ -121,9 +121,9 @@
B5E84F041AFF847B0064E85B /* OrderBy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderBy.swift; sourceTree = "<group>"; };
B5E84F051AFF847B0064E85B /* Where.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Where.swift; sourceTree = "<group>"; };
B5E84F061AFF847B0064E85B /* DataStack+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Querying.swift"; sourceTree = "<group>"; };
B5E84F071AFF847B0064E85B /* HardcoreData+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Querying.swift"; sourceTree = "<group>"; };
B5E84F071AFF847B0064E85B /* CoreStore+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreStore+Querying.swift"; sourceTree = "<group>"; };
B5E84F1A1AFF84860064E85B /* DataStack+Observing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Observing.swift"; sourceTree = "<group>"; };
B5E84F1B1AFF84860064E85B /* HardcoreData+Observing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Observing.swift"; sourceTree = "<group>"; };
B5E84F1B1AFF84860064E85B /* CoreStore+Observing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreStore+Observing.swift"; sourceTree = "<group>"; };
B5E84F1C1AFF84860064E85B /* ManagedObjectController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectController.swift; sourceTree = "<group>"; };
B5E84F1D1AFF84860064E85B /* ManagedObjectListController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectListController.swift; sourceTree = "<group>"; };
B5E84F1E1AFF84860064E85B /* ManagedObjectListObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectListObserver.swift; sourceTree = "<group>"; };
@@ -131,7 +131,7 @@
B5E84F271AFF84920064E85B /* NSManagedObject+Convenience.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Convenience.swift"; sourceTree = "<group>"; };
B5E84F2A1AFF849C0064E85B /* AssociatedObjects.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociatedObjects.swift; sourceTree = "<group>"; };
B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationObserver.swift; sourceTree = "<group>"; };
B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+HardcoreData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+HardcoreData.swift"; sourceTree = "<group>"; };
B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+CoreStore.swift"; sourceTree = "<group>"; };
B5E84F2D1AFF849C0064E85B /* WeakObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeakObject.swift; sourceTree = "<group>"; };
B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Setup.swift"; sourceTree = "<group>"; };
B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Transaction.swift"; sourceTree = "<group>"; };
@@ -167,8 +167,8 @@
children = (
B5D806BB1A34715700A44484 /* Libraries */,
2F291E3119C6D4D3007AF63F /* Frameworks */,
2F03A53219C5C6DA005002A5 /* HardcoreData */,
2F03A53C19C5C6DA005002A5 /* HardcoreDataTests */,
2F03A53219C5C6DA005002A5 /* CoreStore */,
2F03A53C19C5C6DA005002A5 /* CoreStoreTests */,
2F03A53119C5C6DA005002A5 /* Products */,
);
sourceTree = "<group>";
@@ -176,18 +176,18 @@
2F03A53119C5C6DA005002A5 /* Products */ = {
isa = PBXGroup;
children = (
2F03A53019C5C6DA005002A5 /* HardcoreData.framework */,
2F03A53B19C5C6DA005002A5 /* HardcoreDataTests.xctest */,
2F03A53019C5C6DA005002A5 /* CoreStore.framework */,
2F03A53B19C5C6DA005002A5 /* CoreStoreTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
2F03A53219C5C6DA005002A5 /* HardcoreData */ = {
2F03A53219C5C6DA005002A5 /* CoreStore */ = {
isa = PBXGroup;
children = (
2F03A53519C5C6DA005002A5 /* HardcoreData.h */,
2F291E2619C6D3CF007AF63F /* HardcoreData.swift */,
B5D1E22B19FA9FBC003B2874 /* NSError+HardcoreData.swift */,
2F03A53519C5C6DA005002A5 /* CoreStore.h */,
2F291E2619C6D3CF007AF63F /* CoreStore.swift */,
B5D1E22B19FA9FBC003B2874 /* NSError+CoreStore.swift */,
B5E84EDA1AFF84500064E85B /* Setting Up */,
B5E84EE21AFF84610064E85B /* Logging */,
B5E84EE91AFF846E0064E85B /* Saving and Processing */,
@@ -197,7 +197,7 @@
B5E84F291AFF849C0064E85B /* Internal */,
2F03A53319C5C6DA005002A5 /* Supporting Files */,
);
path = HardcoreData;
path = CoreStore;
sourceTree = "<group>";
};
2F03A53319C5C6DA005002A5 /* Supporting Files */ = {
@@ -210,15 +210,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
2F03A53C19C5C6DA005002A5 /* HardcoreDataTests */ = {
2F03A53C19C5C6DA005002A5 /* CoreStoreTests */ = {
isa = PBXGroup;
children = (
2F03A53F19C5C6DA005002A5 /* HardcoreDataTests.swift */,
2F03A53F19C5C6DA005002A5 /* CoreStoreTests.swift */,
B5D372851A39CDDB00F583D9 /* TestEntity1.swift */,
B5D5E0CE1A4D6AAB006468AF /* TestEntity2.swift */,
2F03A53D19C5C6DA005002A5 /* Supporting Files */,
);
path = HardcoreDataTests;
path = CoreStoreTests;
sourceTree = "<group>";
};
2F03A53D19C5C6DA005002A5 /* Supporting Files */ = {
@@ -270,7 +270,7 @@
children = (
B5E84EDB1AFF84500064E85B /* DataStack.swift */,
B5E84EDE1AFF84500064E85B /* PersistentStoreResult.swift */,
B504D0D51B02362500B2BBB1 /* HardcoreData+Setup.swift */,
B504D0D51B02362500B2BBB1 /* CoreStore+Setup.swift */,
);
path = "Setting Up";
sourceTree = "<group>";
@@ -279,8 +279,8 @@
isa = PBXGroup;
children = (
B5E84EE31AFF84610064E85B /* DefaultLogger.swift */,
B5E84EE41AFF84610064E85B /* HardcoreData+Logging.swift */,
B5E84EE51AFF84610064E85B /* HardcoreDataLogger.swift */,
B5E84EE41AFF84610064E85B /* CoreStore+Logging.swift */,
B5E84EE51AFF84610064E85B /* CoreStoreLogger.swift */,
);
path = Logging;
sourceTree = "<group>";
@@ -292,7 +292,7 @@
B5E84EEA1AFF846E0064E85B /* AsynchronousDataTransaction.swift */,
B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */,
B5E84EED1AFF846E0064E85B /* DetachedDataTransaction.swift */,
B5E84EEE1AFF846E0064E85B /* HardcoreData+Transaction.swift */,
B5E84EEE1AFF846E0064E85B /* CoreStore+Transaction.swift */,
B5E84EF21AFF846E0064E85B /* SaveResult.swift */,
B5E84EF31AFF846E0064E85B /* SynchronousDataTransaction.swift */,
);
@@ -304,7 +304,7 @@
children = (
B5E84EFE1AFF847B0064E85B /* BaseDataTransaction+Querying.swift */,
B5E84F061AFF847B0064E85B /* DataStack+Querying.swift */,
B5E84F071AFF847B0064E85B /* HardcoreData+Querying.swift */,
B5E84F071AFF847B0064E85B /* CoreStore+Querying.swift */,
B5E84F0A1AFF847B0064E85B /* Protocol Clauses */,
B5E84EFF1AFF847B0064E85B /* Concrete Clauses */,
);
@@ -336,7 +336,7 @@
isa = PBXGroup;
children = (
B5E84F1A1AFF84860064E85B /* DataStack+Observing.swift */,
B5E84F1B1AFF84860064E85B /* HardcoreData+Observing.swift */,
B5E84F1B1AFF84860064E85B /* CoreStore+Observing.swift */,
B5E84F1C1AFF84860064E85B /* ManagedObjectController.swift */,
B5E84F1F1AFF84860064E85B /* ManagedObjectObserver.swift */,
B5E84F1D1AFF84860064E85B /* ManagedObjectListController.swift */,
@@ -359,7 +359,7 @@
B5E84F2A1AFF849C0064E85B /* AssociatedObjects.swift */,
B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */,
B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */,
B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+HardcoreData.swift */,
B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */,
B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */,
B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */,
B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */,
@@ -375,16 +375,16 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
2F03A53619C5C6DA005002A5 /* HardcoreData.h in Headers */,
2F03A53619C5C6DA005002A5 /* CoreStore.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
2F03A52F19C5C6DA005002A5 /* HardcoreData */ = {
2F03A52F19C5C6DA005002A5 /* CoreStore */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2F03A54319C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "HardcoreData" */;
buildConfigurationList = 2F03A54319C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "CoreStore" */;
buildPhases = (
2F03A52B19C5C6DA005002A5 /* Sources */,
2F03A52C19C5C6DA005002A5 /* Frameworks */,
@@ -395,14 +395,14 @@
);
dependencies = (
);
name = HardcoreData;
productName = HardcoreData;
productReference = 2F03A53019C5C6DA005002A5 /* HardcoreData.framework */;
name = CoreStore;
productName = CoreStore;
productReference = 2F03A53019C5C6DA005002A5 /* CoreStore.framework */;
productType = "com.apple.product-type.framework";
};
2F03A53A19C5C6DA005002A5 /* HardcoreDataTests */ = {
2F03A53A19C5C6DA005002A5 /* CoreStoreTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2F03A54619C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "HardcoreDataTests" */;
buildConfigurationList = 2F03A54619C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "CoreStoreTests" */;
buildPhases = (
2F03A53719C5C6DA005002A5 /* Sources */,
2F03A53819C5C6DA005002A5 /* Frameworks */,
@@ -413,9 +413,9 @@
dependencies = (
B5D372881A39CF4D00F583D9 /* PBXTargetDependency */,
);
name = HardcoreDataTests;
productName = HardcoreDataTests;
productReference = 2F03A53B19C5C6DA005002A5 /* HardcoreDataTests.xctest */;
name = CoreStoreTests;
productName = CoreStoreTests;
productReference = 2F03A53B19C5C6DA005002A5 /* CoreStoreTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
@@ -435,7 +435,7 @@
};
};
};
buildConfigurationList = 2F03A52A19C5C6DA005002A5 /* Build configuration list for PBXProject "HardcoreData" */;
buildConfigurationList = 2F03A52A19C5C6DA005002A5 /* Build configuration list for PBXProject "CoreStore" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
@@ -454,8 +454,8 @@
);
projectRoot = "";
targets = (
2F03A52F19C5C6DA005002A5 /* HardcoreData */,
2F03A53A19C5C6DA005002A5 /* HardcoreDataTests */,
2F03A52F19C5C6DA005002A5 /* CoreStore */,
2F03A53A19C5C6DA005002A5 /* CoreStoreTests */,
);
};
/* End PBXProject section */
@@ -500,21 +500,21 @@
buildActionMask = 2147483647;
files = (
B5E84F221AFF84860064E85B /* ManagedObjectController.swift in Sources */,
B504D0D61B02362500B2BBB1 /* HardcoreData+Setup.swift in Sources */,
B5D1E22C19FA9FBC003B2874 /* NSError+HardcoreData.swift in Sources */,
B504D0D61B02362500B2BBB1 /* CoreStore+Setup.swift in Sources */,
B5D1E22C19FA9FBC003B2874 /* NSError+CoreStore.swift in Sources */,
B5E84F131AFF847B0064E85B /* Where.swift in Sources */,
B5E84F141AFF847B0064E85B /* DataStack+Querying.swift in Sources */,
B5E84F371AFF85470064E85B /* NSManagedObjectContext+Transaction.swift in Sources */,
B5E84F0E1AFF847B0064E85B /* Tweak.swift in Sources */,
B5E84F121AFF847B0064E85B /* OrderBy.swift in Sources */,
B5E84F361AFF85470064E85B /* NSManagedObjectContext+Setup.swift in Sources */,
B5E84EE71AFF84610064E85B /* HardcoreData+Logging.swift in Sources */,
B5E84EE71AFF84610064E85B /* CoreStore+Logging.swift in Sources */,
B5E84F111AFF847B0064E85B /* Select.swift in Sources */,
B5E84EE11AFF84500064E85B /* PersistentStoreResult.swift in Sources */,
B5E84F251AFF84860064E85B /* ManagedObjectObserver.swift in Sources */,
B5E84F2F1AFF849C0064E85B /* NotificationObserver.swift in Sources */,
B5E84F381AFF85470064E85B /* NSManagedObject+Transaction.swift in Sources */,
2F291E2719C6D3CF007AF63F /* HardcoreData.swift in Sources */,
2F291E2719C6D3CF007AF63F /* CoreStore.swift in Sources */,
B5E84F411AFF8CCD0064E85B /* ClauseTypes.swift in Sources */,
B5E84F0D1AFF847B0064E85B /* BaseDataTransaction+Querying.swift in Sources */,
B5E84EF61AFF846E0064E85B /* DataStack+Transaction.swift in Sources */,
@@ -527,16 +527,16 @@
B5E84EFC1AFF846E0064E85B /* SynchronousDataTransaction.swift in Sources */,
B5E84F281AFF84920064E85B /* NSManagedObject+Convenience.swift in Sources */,
B5E84F391AFF85470064E85B /* NSManagedObjectContext+Querying.swift in Sources */,
B5E84EE81AFF84610064E85B /* HardcoreDataLogger.swift in Sources */,
B5E84EE81AFF84610064E85B /* CoreStoreLogger.swift in Sources */,
B5E84F311AFF849C0064E85B /* WeakObject.swift in Sources */,
B5E84F101AFF847B0064E85B /* GroupBy.swift in Sources */,
B5E84F201AFF84860064E85B /* DataStack+Observing.swift in Sources */,
B5E84EF81AFF846E0064E85B /* HardcoreData+Transaction.swift in Sources */,
B5E84F301AFF849C0064E85B /* NSManagedObjectContext+HardcoreData.swift in Sources */,
B5E84F211AFF84860064E85B /* HardcoreData+Observing.swift in Sources */,
B5E84EF81AFF846E0064E85B /* CoreStore+Transaction.swift in Sources */,
B5E84F301AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift in Sources */,
B5E84F211AFF84860064E85B /* CoreStore+Observing.swift in Sources */,
B5E84EE61AFF84610064E85B /* DefaultLogger.swift in Sources */,
B5E84EF41AFF846E0064E85B /* AsynchronousDataTransaction.swift in Sources */,
B5E84F151AFF847B0064E85B /* HardcoreData+Querying.swift in Sources */,
B5E84F151AFF847B0064E85B /* CoreStore+Querying.swift in Sources */,
B5E84F241AFF84860064E85B /* ManagedObjectListObserver.swift in Sources */,
B5E84F2E1AFF849C0064E85B /* AssociatedObjects.swift in Sources */,
);
@@ -546,7 +546,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2F03A54019C5C6DA005002A5 /* HardcoreDataTests.swift in Sources */,
2F03A54019C5C6DA005002A5 /* CoreStoreTests.swift in Sources */,
B5D372861A39CDDB00F583D9 /* TestEntity1.swift in Sources */,
B5D372841A39CD6900F583D9 /* Model.xcdatamodeld in Sources */,
B5D5E0CF1A4D6AAB006468AF /* TestEntity2.swift in Sources */,
@@ -558,7 +558,7 @@
/* Begin PBXTargetDependency section */
B5D372881A39CF4D00F583D9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2F03A52F19C5C6DA005002A5 /* HardcoreData */;
target = 2F03A52F19C5C6DA005002A5 /* CoreStore */;
targetProxy = B5D372871A39CF4D00F583D9 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@@ -663,7 +663,7 @@
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/PhotoSearch-dzwflhandxxuvngptapvysfpcwdx/Build/Products/Debug-iphoneos",
);
INFOPLIST_FILE = HardcoreData/Info.plist;
INFOPLIST_FILE = CoreStore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -687,7 +687,7 @@
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/PhotoSearch-dzwflhandxxuvngptapvysfpcwdx/Build/Products/Debug-iphoneos",
);
INFOPLIST_FILE = HardcoreData/Info.plist;
INFOPLIST_FILE = CoreStore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -708,7 +708,7 @@
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = HardcoreDataTests/Info.plist;
INFOPLIST_FILE = CoreStoreTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
@@ -722,7 +722,7 @@
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
INFOPLIST_FILE = HardcoreDataTests/Info.plist;
INFOPLIST_FILE = CoreStoreTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
@@ -731,7 +731,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2F03A52A19C5C6DA005002A5 /* Build configuration list for PBXProject "HardcoreData" */ = {
2F03A52A19C5C6DA005002A5 /* Build configuration list for PBXProject "CoreStore" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2F03A54119C5C6DA005002A5 /* Debug */,
@@ -740,7 +740,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2F03A54319C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "HardcoreData" */ = {
2F03A54319C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "CoreStore" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2F03A54419C5C6DA005002A5 /* Debug */,
@@ -749,7 +749,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2F03A54619C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "HardcoreDataTests" */ = {
2F03A54619C5C6DA005002A5 /* Build configuration list for PBXNativeTarget "CoreStoreTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2F03A54719C5C6DA005002A5 /* Debug */,

View File

@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:HardcoreData.xcodeproj">
location = "self:CoreStore.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>F347F55F-7F5C-4476-9148-6E902F06E4AD</string>
<key>IDESourceControlProjectName</key>
<string>CoreStore</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
<string>github.com:JohnEstropia/CoreStore.git</string>
<key>8B2E522D57154DFA93A06982C36315ECBEA4FA97</key>
<string>github.com:JohnEstropia/GCDKit.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>CoreStore.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
<string>../..</string>
<key>8B2E522D57154DFA93A06982C36315ECBEA4FA97</key>
<string>../..Libraries/GCDKit/</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:JohnEstropia/CoreStore.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>4B60F1BCB491FF717C56441AE7783C74F417BE48</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>4B60F1BCB491FF717C56441AE7783C74F417BE48</string>
<key>IDESourceControlWCCName</key>
<string>CoreStore</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>8B2E522D57154DFA93A06982C36315ECBEA4FA97</string>
<key>IDESourceControlWCCName</key>
<string>GCDKit</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F03A52F19C5C6DA005002A5"
BuildableName = "CoreStore.framework"
BlueprintName = "CoreStore"
ReferencedContainer = "container:CoreStore.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F03A53A19C5C6DA005002A5"
BuildableName = "CoreStoreTests.xctest"
BlueprintName = "CoreStoreTests"
ReferencedContainer = "container:CoreStore.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F03A53A19C5C6DA005002A5"
BuildableName = "CoreStoreTests.xctest"
BlueprintName = "CoreStoreTests"
ReferencedContainer = "container:CoreStore.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F03A52F19C5C6DA005002A5"
BuildableName = "CoreStore.framework"
BlueprintName = "CoreStore"
ReferencedContainer = "container:CoreStore.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F03A52F19C5C6DA005002A5"
BuildableName = "CoreStore.framework"
BlueprintName = "CoreStore"
ReferencedContainer = "container:CoreStore.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F03A52F19C5C6DA005002A5"
BuildableName = "CoreStore.framework"
BlueprintName = "CoreStore"
ReferencedContainer = "container:CoreStore.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CoreStore.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>2F03A52F19C5C6DA005002A5</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>2F03A53A19C5C6DA005002A5</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@@ -1,6 +1,6 @@
//
// NSManagedObject+Convenience.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -46,4 +46,4 @@ public extension NSManagedObject {
self.setPrimitiveValue(value, forKey: KVCKey)
self.didChangeValueForKey(KVCKey)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// HardcoreData.h
// HardcoreData
// CoreStore.h
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -25,6 +25,6 @@
#import <CoreData/CoreData.h>
FOUNDATION_EXPORT double HardcoreDataVersionNumber;
FOUNDATION_EXPORT const unsigned char HardcoreDataVersionString[];
FOUNDATION_EXPORT double CoreStoreVersionNumber;
FOUNDATION_EXPORT const unsigned char CoreStoreVersionString[];

View File

@@ -1,6 +1,6 @@
//
// HardcoreData.swift
// HardcoreData
// CoreStore.swift
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -30,15 +30,15 @@ import GCDKit
/**
Okay, okay. This one's shorter.
*/
public typealias HCD = HardcoreData
public typealias HCD = CoreStore
// MARK: - HardcoreData
// MARK: - CoreStore
/**
`HardcoreData` is the main entry point for all other APIs.
`CoreStore` is the main entry point for all other APIs.
*/
public enum HardcoreData {
public enum CoreStore {
// MARK: Public
@@ -72,7 +72,7 @@ public enum HardcoreData {
// MARK: Private
private static let defaultStackBarrierQueue = GCDQueue.createConcurrent("com.hardcoreData.defaultStackBarrierQueue")
private static let defaultStackBarrierQueue = GCDQueue.createConcurrent("com.coreStore.defaultStackBarrierQueue")
private static var defaultStackInstance: DataStack?
}

View File

@@ -1,6 +1,6 @@
//
// BaseDataTransaction+Querying.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -42,7 +42,7 @@ public extension BaseDataTransaction {
*/
public func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> T? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchOne(from, fetchClauses)
}
@@ -56,7 +56,7 @@ public extension BaseDataTransaction {
*/
public func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> T? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchOne(from, fetchClauses)
}
@@ -70,7 +70,7 @@ public extension BaseDataTransaction {
*/
public func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [T]? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchAll(from, fetchClauses)
}
@@ -84,7 +84,7 @@ public extension BaseDataTransaction {
*/
public func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [T]? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchAll(from, fetchClauses)
}
@@ -98,7 +98,7 @@ public extension BaseDataTransaction {
*/
public func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> Int? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchCount(from, fetchClauses)
}
@@ -112,7 +112,7 @@ public extension BaseDataTransaction {
*/
public func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> Int? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchCount(from, fetchClauses)
}
@@ -126,7 +126,7 @@ public extension BaseDataTransaction {
*/
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchObjectID(from, fetchClauses)
}
@@ -140,7 +140,7 @@ public extension BaseDataTransaction {
*/
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchObjectID(from, fetchClauses)
}
@@ -154,7 +154,7 @@ public extension BaseDataTransaction {
*/
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchObjectIDs(from, fetchClauses)
}
@@ -168,7 +168,7 @@ public extension BaseDataTransaction {
*/
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside its designated queue.")
return self.context.fetchObjectIDs(from, fetchClauses)
}
@@ -182,7 +182,7 @@ public extension BaseDataTransaction {
*/
public func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: DeleteClause...) -> Int? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to delete from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to delete from a \(typeName(self)) outside its designated queue.")
return self.context.deleteAll(from, deleteClauses)
}
@@ -196,7 +196,7 @@ public extension BaseDataTransaction {
*/
public func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: [DeleteClause]) -> Int? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to delete from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to delete from a \(typeName(self)) outside its designated queue.")
return self.context.deleteAll(from, deleteClauses)
}
@@ -213,7 +213,7 @@ public extension BaseDataTransaction {
*/
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: QueryClause...) -> U? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
return self.context.queryValue(from, selectClause, queryClauses)
}
@@ -230,7 +230,7 @@ public extension BaseDataTransaction {
*/
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [QueryClause]) -> U? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
return self.context.queryValue(from, selectClause, queryClauses)
}
@@ -247,7 +247,7 @@ public extension BaseDataTransaction {
*/
public func queryAttributes<T: NSManagedObject>(from: From<T>, _ selectClause: Select<NSDictionary>, _ queryClauses: QueryClause...) -> [[NSString: AnyObject]]? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
return self.context.queryAttributes(from, selectClause, queryClauses)
}
@@ -264,8 +264,8 @@ public extension BaseDataTransaction {
*/
public func queryAttributes<T: NSManagedObject>(from: From<T>, _ selectClause: Select<NSDictionary>, _ queryClauses: [QueryClause]) -> [[NSString: AnyObject]]? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside its designated queue.")
return self.context.queryAttributes(from, selectClause, queryClauses)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// From.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// GroupBy.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -74,7 +74,7 @@ public struct GroupBy: QueryClause {
if fetchRequest.propertiesToGroupBy != nil {
HardcoreData.log(.Warning, message: "An existing \"propertiesToGroupBy\" for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
CoreStore.log(.Warning, message: "An existing \"propertiesToGroupBy\" for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
}
fetchRequest.propertiesToGroupBy = self.keyPaths

View File

@@ -1,6 +1,6 @@
//
// OrderBy.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -135,7 +135,7 @@ public struct OrderBy: FetchClause, QueryClause, DeleteClause {
if fetchRequest.sortDescriptors != nil {
HardcoreData.log(.Warning, message: "Existing sortDescriptors for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
CoreStore.log(.Warning, message: "Existing sortDescriptors for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
}
fetchRequest.sortDescriptors = self.sortDescriptors

View File

@@ -1,6 +1,6 @@
//
// Select.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -69,7 +69,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying an entity attribute. A shorter way to do the same is to assign from the string keypath directly:
let fullName = HardcoreData.queryValue(
let fullName = CoreStore.queryValue(
From(MyPersonEntity),
Select<String>(.Attribute("fullName")),
Where("employeeID", isEqualTo: 1111)
@@ -77,7 +77,7 @@ public enum SelectTerm: StringLiteralConvertible {
is equivalent to:
let fullName = HardcoreData.queryValue(
let fullName = CoreStore.queryValue(
From(MyPersonEntity),
Select<String>("fullName"),
Where("employeeID", isEqualTo: 1111)
@@ -94,7 +94,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying the average value of an attribute.
let averageAge = HardcoreData.queryValue(
let averageAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Average("age"))
)
@@ -115,7 +115,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for a count query.
let numberOfEmployees = HardcoreData.queryValue(
let numberOfEmployees = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Count("employeeID"))
)
@@ -136,7 +136,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying the maximum value for an attribute.
let maximumAge = HardcoreData.queryValue(
let maximumAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Maximum("age"))
)
@@ -157,7 +157,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying the median value for an attribute.
let medianAge = HardcoreData.queryValue(
let medianAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Median("age"))
)
@@ -178,7 +178,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying the minimum value for an attribute.
let minimumAge = HardcoreData.queryValue(
let minimumAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Median("age"))
)
@@ -199,7 +199,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying the standard deviation value for an attribute.
let stddevAge = HardcoreData.queryValue(
let stddevAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.StandardDeviation("age"))
)
@@ -220,7 +220,7 @@ public enum SelectTerm: StringLiteralConvertible {
/**
Provides a `SelectTerm` to a `Select` clause for querying the sum value for an attribute.
let totalAge = HardcoreData.queryValue(
let totalAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Sum("age"))
)
@@ -271,14 +271,14 @@ The `Select` clause indicates the attribute / aggregate value to be queried. The
You can bind the return type by specializing the initializer:
let maximumAge = HardcoreData.queryValue(
let maximumAge = CoreStore.queryValue(
From(MyPersonEntity),
Select<Int>(.Maximum("age"))
)
or by casting the type of the return value:
let maximumAge: Int = HardcoreData.queryValue(
let maximumAge: Int = CoreStore.queryValue(
From(MyPersonEntity),
Select(.Maximum("age"))
)
@@ -333,7 +333,7 @@ public struct Select<T: SelectResultType> {
if fetchRequest.propertiesToFetch != nil {
HardcoreData.log(.Warning, message: "An existing \"propertiesToFetch\" for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
CoreStore.log(.Warning, message: "An existing \"propertiesToFetch\" for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
}
fetchRequest.includesPendingChanges = false
@@ -355,7 +355,7 @@ public struct Select<T: SelectResultType> {
}
else {
HardcoreData.log(.Warning, message: "The property \"\(keyPath)\" does not exist in entity <\(entityDescription.managedObjectClassName)> and will be ignored by \(typeName(self)) query clause.")
CoreStore.log(.Warning, message: "The property \"\(keyPath)\" does not exist in entity <\(entityDescription.managedObjectClassName)> and will be ignored by \(typeName(self)) query clause.")
}
case ._Aggregate(let function, let keyPath, let alias):
@@ -373,7 +373,7 @@ public struct Select<T: SelectResultType> {
}
else {
HardcoreData.log(.Warning, message: "The attribute \"\(keyPath)\" does not exist in entity <\(entityDescription.managedObjectClassName)> and will be ignored by \(typeName(self)) query clause.")
CoreStore.log(.Warning, message: "The attribute \"\(keyPath)\" does not exist in entity <\(entityDescription.managedObjectClassName)> and will be ignored by \(typeName(self)) query clause.")
}
}
}

View File

@@ -1,6 +1,6 @@
//
// Tweak.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// Where.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -123,7 +123,7 @@ public struct Where: FetchClause, QueryClause, DeleteClause {
if fetchRequest.predicate != nil {
HardcoreData.log(.Warning, message: "An existing predicate for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
CoreStore.log(.Warning, message: "An existing predicate for the <\(NSFetchRequest.self)> was overwritten by \(typeName(self)) query clause.")
}
fetchRequest.predicate = self.predicate

View File

@@ -1,6 +1,6 @@
//
// HardcoreData+Querying.swift
// HardcoreData
// CoreStore+Querying.swift
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -25,9 +25,9 @@
import Foundation
// MARK: - HardcoreData
// MARK: - CoreStore
public extension HardcoreData {
public extension CoreStore {
// MARK: Public
@@ -210,4 +210,4 @@ public extension HardcoreData {
return self.defaultStack.queryAttributes(from, selectClause, queryClauses)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// DataStack+Querying.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -43,7 +43,7 @@ public extension DataStack {
*/
public func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> T? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchOne(from, fetchClauses)
}
@@ -57,7 +57,7 @@ public extension DataStack {
*/
public func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> T? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchOne(from, fetchClauses)
}
@@ -71,7 +71,7 @@ public extension DataStack {
*/
public func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [T]? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchAll(from, fetchClauses)
}
@@ -85,7 +85,7 @@ public extension DataStack {
*/
public func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [T]? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchAll(from, fetchClauses)
}
@@ -99,7 +99,7 @@ public extension DataStack {
*/
public func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> Int? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchCount(from, fetchClauses)
}
@@ -113,7 +113,7 @@ public extension DataStack {
*/
public func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> Int? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchCount(from, fetchClauses)
}
@@ -127,7 +127,7 @@ public extension DataStack {
*/
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchObjectID(from, fetchClauses)
}
@@ -141,7 +141,7 @@ public extension DataStack {
*/
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchObjectID(from, fetchClauses)
}
@@ -155,7 +155,7 @@ public extension DataStack {
*/
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchObjectIDs(from, fetchClauses)
}
@@ -169,7 +169,7 @@ public extension DataStack {
*/
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to fetch from a \(typeName(self)) outside the main thread.")
return self.mainContext.fetchObjectIDs(from, fetchClauses)
}
@@ -186,7 +186,7 @@ public extension DataStack {
*/
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: QueryClause...) -> U? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
return self.mainContext.queryValue(from, selectClause, queryClauses)
}
@@ -203,7 +203,7 @@ public extension DataStack {
*/
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [QueryClause]) -> U? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
return self.mainContext.queryValue(from, selectClause, queryClauses)
}
@@ -220,7 +220,7 @@ public extension DataStack {
*/
public func queryAttributes<T: NSManagedObject>(from: From<T>, _ selectClause: Select<NSDictionary>, _ queryClauses: QueryClause...) -> [[NSString: AnyObject]]? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
return self.mainContext.queryAttributes(from, selectClause, queryClauses)
}
@@ -237,7 +237,7 @@ public extension DataStack {
*/
public func queryAttributes<T: NSManagedObject>(from: From<T>, _ selectClause: Select<NSDictionary>, _ queryClauses: [QueryClause]) -> [[NSString: AnyObject]]? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to query from a \(typeName(self)) outside the main thread.")
return self.mainContext.queryAttributes(from, selectClause, queryClauses)
}

View File

@@ -1,6 +1,6 @@
//
// ClauseTypes.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// NSObject+HardcoreData.swift
// HardcoreData
// NSObject+CoreStore.swift
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// NSManagedObject+Transaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -70,8 +70,8 @@ internal extension NSManagedObject {
}
if didSucceed != true {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to obtain permanent ID for object.")
return nil
}
@@ -83,9 +83,9 @@ internal extension NSManagedObject {
return (existingObject as! T)
}
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to load existing <\(T.self)> in context.")
return nil;
}
}
}

View File

@@ -1,6 +1,6 @@
//
// NSManagedObjectContext+HardcoreData.swift
// HardcoreData
// NSManagedObjectContext+CoreStore.swift
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -66,7 +66,7 @@ internal extension NSManagedObjectContext {
return nil
}
internal func setupForHardcoreDataWithContextName(contextName: String) {
internal func setupForCoreStoreWithContextName(contextName: String) {
if self.respondsToSelector("setName:") {
@@ -92,8 +92,8 @@ internal extension NSManagedObjectContext {
return
}
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to obtain permanent ID(s) for \(numberOfInsertedObjects) inserted object(s)."
)
}

View File

@@ -1,6 +1,6 @@
//
// NSManagedObjectContext+Querying.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -59,8 +59,8 @@ internal extension NSManagedObjectContext {
}
if fetchResults == nil {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -94,8 +94,8 @@ internal extension NSManagedObjectContext {
}
if fetchResults == nil {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -126,8 +126,8 @@ internal extension NSManagedObjectContext {
}
if count == NSNotFound {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -161,8 +161,8 @@ internal extension NSManagedObjectContext {
}
if fetchResults == nil {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -196,8 +196,8 @@ internal extension NSManagedObjectContext {
}
if fetchResults == nil {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -242,8 +242,8 @@ internal extension NSManagedObjectContext {
}
if numberOfDeletedObjects == nil {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -286,8 +286,8 @@ internal extension NSManagedObjectContext {
return nil
}
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
@@ -322,9 +322,9 @@ internal extension NSManagedObjectContext {
return Select<NSDictionary>.ReturnType.fromResultObjects(fetchResults)
}
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed executing fetch request.")
return nil
}
}
}

View File

@@ -1,6 +1,6 @@
//
// NSManagedObjectContext+Setup.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -65,7 +65,7 @@ internal extension NSManagedObjectContext {
context.persistentStoreCoordinator = coordinator
context.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
context.undoManager = nil
context.setupForHardcoreDataWithContextName("com.hardcoredata.rootcontext")
context.setupForCoreStoreWithContextName("com.corestore.rootcontext")
return context
}
@@ -76,7 +76,7 @@ internal extension NSManagedObjectContext {
context.parentContext = rootContext
context.shouldCascadeSavesToParent = true
context.undoManager = nil
context.setupForHardcoreDataWithContextName("com.hardcoredata.maincontext")
context.setupForCoreStoreWithContextName("com.corestore.maincontext")
context.observerForDidSaveNotification = NotificationObserver(
notificationName: NSManagedObjectContextDidSaveNotification,
object: rootContext,

View File

@@ -1,6 +1,6 @@
//
// NSManagedObjectContext+Transaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -58,7 +58,7 @@ internal extension NSManagedObjectContext {
let context = NSManagedObjectContext(concurrencyType: concurrencyType)
context.parentContext = self
context.parentStack = self.parentStack
context.setupForHardcoreDataWithContextName("com.hardcoredata.temporarycontext")
context.setupForCoreStoreWithContextName("com.corestore.temporarycontext")
context.shouldCascadeSavesToParent = (self.parentStack?.rootSavingContext == self)
context.retainsRegisteredObjects = true
@@ -98,7 +98,7 @@ internal extension NSManagedObjectContext {
}
else if let error = saveError {
HardcoreData.handleError(
CoreStore.handleError(
error,
"Failed to save <\(NSManagedObjectContext.self)>.")
result = SaveResult(error)
@@ -157,7 +157,7 @@ internal extension NSManagedObjectContext {
}
else if let error = saveError {
HardcoreData.handleError(
CoreStore.handleError(
error,
"Failed to save <\(NSManagedObjectContext.self)>.")
if let completion = completion {
@@ -185,4 +185,4 @@ internal extension NSManagedObjectContext {
static var parentTransaction: Void?
}
}
}

View File

@@ -1,6 +1,6 @@
//
// NotificationObserver.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// WeakObject.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// HardcoreData+Logging.swift
// HardcoreData
// CoreStore+Logging.swift
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -26,16 +26,16 @@
import Foundation
// MARK: - HardcoreData
// MARK: - CoreStore
public extension HardcoreData {
public extension CoreStore {
// MARK: Public
/**
The `HardcoreDataLogger` instance to be used. The default logger is an instance of a `DefaultLogger`.
The `CoreStoreLogger` instance to be used. The default logger is an instance of a `DefaultLogger`.
*/
public static var logger: HardcoreDataLogger = DefaultLogger()
public static var logger: CoreStoreLogger = DefaultLogger()
// MARK: Internal
@@ -72,4 +72,4 @@ public extension HardcoreData {
lineNumber: lineNumber,
functionName: functionName)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// HardcoreDataLogger.swift
// HardcoreData
// CoreStoreLogger.swift
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -40,15 +40,15 @@ public enum LogLevel {
}
// MARK: - HardcoreDataLogger
// MARK: - CoreStoreLogger
/**
Custom loggers should implement the `HardcoreDataLogger` protocol and pass its instance to `HardcoreData.logger`. Calls to `log(...)`, `handleError(...)`, and `assert(...)` are not tied to a specific queue/thread, so it is the implementer's job to handle thread-safety.
Custom loggers should implement the `CoreStoreLogger` protocol and pass its instance to `CoreStore.logger`. Calls to `log(...)`, `handleError(...)`, and `assert(...)` are not tied to a specific queue/thread, so it is the implementer's job to handle thread-safety.
*/
public protocol HardcoreDataLogger {
public protocol CoreStoreLogger {
/**
Handles log messages sent by the `HardcoreData` framework.
Handles log messages sent by the `CoreStore` framework.
:level: the severity of the log message
:message: the log message
@@ -59,7 +59,7 @@ public protocol HardcoreDataLogger {
func log(#level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
/**
Handles errors sent by the `HardcoreData` framework.
Handles errors sent by the `CoreStore` framework.
:error: the error
:message: the error message
@@ -70,7 +70,7 @@ public protocol HardcoreDataLogger {
func handleError(#error: NSError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)
/**
Handles assertions made throughout the `HardcoreData` framework.
Handles assertions made throughout the `CoreStore` framework.
:condition: the assertion condition
:message: the assertion message

View File

@@ -1,6 +1,6 @@
//
// DefaultLogger.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -29,13 +29,13 @@ import Foundation
// MARK: - DefaultLogger
/**
The `DefaultLogger` is a basic implementation of the `HardcoreDataLogger` protocol.
The `DefaultLogger` is a basic implementation of the `CoreStoreLogger` protocol.
- The `log(...)` method calls `println(...)` to print the level, source file name, line number, function name, and the log message.
- The `handleError(...)` method calls `println(...)` to print the source file name, line number, function name, and the error message.
- The `assert(...)` method calls `assert(...)` on the arguments.
*/
public final class DefaultLogger: HardcoreDataLogger {
public final class DefaultLogger: CoreStoreLogger {
public func log(#level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString) {
@@ -47,14 +47,14 @@ public final class DefaultLogger: HardcoreDataLogger {
case .Warning: levelString = "Warning"
case .Fatal: levelString = "Fatal"
}
Swift.println("[HardcoreData:\(levelString)] \(fileName.stringValue.lastPathComponent):\(lineNumber) \(functionName)\n ↪︎ \(message)\n")
Swift.println("[CoreStore:\(levelString)] \(fileName.stringValue.lastPathComponent):\(lineNumber) \(functionName)\n ↪︎ \(message)\n")
#endif
}
public func handleError(#error: NSError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString) {
#if DEBUG
Swift.println("[HardcoreData:Error] \(fileName.stringValue.lastPathComponent):\(lineNumber) \(functionName)\n ↪︎ \(message): \(error)\n")
Swift.println("[CoreStore:Error] \(fileName.stringValue.lastPathComponent):\(lineNumber) \(functionName)\n ↪︎ \(message): \(error)\n")
#endif
}

View File

@@ -1,6 +1,6 @@
//
// NSError+HardcoreData.swift
// HardcoreData
// NSError+CoreStore.swift
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -26,14 +26,14 @@
import Foundation
/**
The `NSError` error domain for `HardcoreData`.
The `NSError` error domain for `CoreStore`.
*/
public let HardcoreDataErrorDomain = "com.hardcoredata.error"
public let CoreStoreErrorDomain = "com.corestore.error"
/**
The `NSError` error codes for `HardcoreDataErrorDomain`.
The `NSError` error codes for `CoreStoreErrorDomain`.
*/
public enum HardcoreDataErrorCode: Int {
public enum CoreStoreErrorCode: Int {
/**
A failure occured because of an unknown error.
@@ -47,33 +47,33 @@ public enum HardcoreDataErrorCode: Int {
}
// MARK: - NSError+HardcoreData
// MARK: - NSError+CoreStore
public extension NSError {
/**
If the error's domain is equal to `HardcoreDataErrorDomain`, returns the associated `HardcoreDataErrorCode`. For other domains, returns `nil`.
If the error's domain is equal to `CoreStoreErrorDomain`, returns the associated `CoreStoreErrorCode`. For other domains, returns `nil`.
*/
public var hardcoreDataErrorCode: HardcoreDataErrorCode? {
public var coreStoreErrorCode: CoreStoreErrorCode? {
return (self.domain == HardcoreDataErrorDomain
? HardcoreDataErrorCode(rawValue: self.code)
return (self.domain == CoreStoreErrorDomain
? CoreStoreErrorCode(rawValue: self.code)
: nil)
}
// MARK: Internal
internal convenience init(hardcoreDataErrorCode: HardcoreDataErrorCode) {
internal convenience init(coreStoreErrorCode: CoreStoreErrorCode) {
self.init(hardcoreDataErrorCode: hardcoreDataErrorCode, userInfo: nil)
self.init(coreStoreErrorCode: coreStoreErrorCode, userInfo: nil)
}
internal convenience init(hardcoreDataErrorCode: HardcoreDataErrorCode, userInfo: [NSObject: AnyObject]?) {
internal convenience init(coreStoreErrorCode: CoreStoreErrorCode, userInfo: [NSObject: AnyObject]?) {
self.init(
domain: HardcoreDataErrorDomain,
code: hardcoreDataErrorCode.rawValue,
domain: CoreStoreErrorDomain,
code: coreStoreErrorCode.rawValue,
userInfo: userInfo)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// HardcoreData+Observing.swift
// HardcoreData
// CoreStore+Observing.swift
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -27,9 +27,9 @@ import Foundation
import CoreData
// MARK: - HardcoreData
// MARK: - CoreStore
public extension HardcoreData {
public extension CoreStore {
// MARK: Public
@@ -93,4 +93,4 @@ public extension HardcoreData {
return self.defaultStack.observeSectionedList(from, sectionedBy, fetchClauses)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// DataStack+Observing.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -42,7 +42,7 @@ public extension DataStack {
*/
public func observeObject<T: NSManagedObject>(object: T) -> ManagedObjectController<T> {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to observe objects from \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to observe objects from \(typeName(self)) outside the main thread.")
return ManagedObjectController(
dataStack: self,
@@ -71,7 +71,7 @@ public extension DataStack {
*/
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> ManagedObjectListController<T> {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to observe objects from \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to observe objects from \(typeName(self)) outside the main thread.")
return ManagedObjectListController(
dataStack: self,
@@ -104,7 +104,7 @@ public extension DataStack {
*/
public func observeSectionedList<T: NSManagedObject>(from: From<T>, _ sectionedBy: SectionedBy, _ fetchClauses: [FetchClause]) -> ManagedObjectListController<T> {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to observe objects from \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to observe objects from \(typeName(self)) outside the main thread.")
return ManagedObjectListController(
dataStack: self,

View File

@@ -1,6 +1,6 @@
//
// ManagedObjectController.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -47,7 +47,7 @@ private struct NotificationKey {
/**
The `ManagedObjectController` monitors changes to a single `NSManagedObject` instance. Observers that implement the `ManagedObjectObserver` protocol may then register themselves to the `ManagedObjectController`'s `addObserver(_:)` method:
let objectController = HardcoreData.observeObject(object)
let objectController = CoreStore.observeObject(object)
objectController.addObserver(self)
The created `ManagedObjectController` instance needs to be held on (retained) for as long as the object needs to be observed.
@@ -87,7 +87,7 @@ public final class ManagedObjectController<T: NSManagedObject> {
*/
public func addObserver<U: ManagedObjectObserver where U.EntityType == T>(observer: U) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
self.removeObserver(observer)
@@ -155,7 +155,7 @@ public final class ManagedObjectController<T: NSManagedObject> {
*/
public func removeObserver<U: ManagedObjectObserver where U.EntityType == T>(observer: U) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to remove an observer of type \(typeName(observer)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to remove an observer of type \(typeName(observer)) outside the main thread.")
let nilValue: AnyObject? = nil
setAssociatedRetainedObject(nilValue, forKey: &NotificationKey.willChangeObject, inObject: observer)
@@ -199,8 +199,8 @@ public final class ManagedObjectController<T: NSManagedObject> {
var error: NSError?
if !fetchedResultsController.performFetch(&error) {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to perform fetch on <\(NSFetchedResultsController.self)>.")
}

View File

@@ -1,6 +1,6 @@
//
// ManagedObjectListController.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -33,7 +33,7 @@ import GCDKit
/**
The `SectionedBy` clause indicates the key path to use to group the `ManagedObjectListController` objects into sections. An optional closure can also be provided to transform the value into an appropriate section name:
let listController = HardcoreData.observeSectionedList(
let listController = CoreStore.observeSectionedList(
From(MyPersonEntity),
SectionedBy("age") { "Age \($0)" },
OrderBy(.Ascending("lastName"))
@@ -78,7 +78,7 @@ public struct SectionedBy {
/**
The `ManagedObjectListController` monitors changes to a list of `NSManagedObject` instances. Observers that implement the `ManagedObjectListChangeObserver` protocol may then register themselves to the `ManagedObjectListController`'s `addObserver(_:)` method:
let listController = HardcoreData.observeObjectList(
let listController = CoreStore.observeObjectList(
From(MyPersonEntity),
Where("title", isEqualTo: "Engineer"),
OrderBy(.Ascending("lastName"))
@@ -96,7 +96,7 @@ Accessing the list with an index above the valid range will throw an exception.
Creating a sectioned-list is also possible with the `observeSectionedList(...)` method:
let listController = HardcoreData.observeSectionedList(
let listController = CoreStore.observeSectionedList(
From(MyPersonEntity),
SectionedBy("age") { "Age \($0)" },
Where("title", isEqualTo: "Engineer"),
@@ -188,7 +188,7 @@ public final class ManagedObjectListController<T: NSManagedObject> {
*/
public func addObserver<U: ManagedObjectListChangeObserver where U.EntityType == T>(observer: U) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
self.removeObserver(observer)
@@ -231,7 +231,7 @@ public final class ManagedObjectListController<T: NSManagedObject> {
*/
public func addObserver<U: ManagedObjectListObjectObserver where U.EntityType == T>(observer: U) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
self.removeObserver(observer)
@@ -340,7 +340,7 @@ public final class ManagedObjectListController<T: NSManagedObject> {
*/
public func addObserver<U: ManagedObjectListSectionObserver where U.EntityType == T>(observer: U) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to add an observer of type \(typeName(observer)) outside the main thread.")
self.removeObserver(observer)
@@ -478,7 +478,7 @@ public final class ManagedObjectListController<T: NSManagedObject> {
*/
public func removeObserver<U: ManagedObjectListChangeObserver where U.EntityType == T>(observer: U) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to remove an observer of type \(typeName(observer)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to remove an observer of type \(typeName(observer)) outside the main thread.")
let nilValue: AnyObject? = nil
setAssociatedRetainedObject(nilValue, forKey: &NotificationKey.willChangeList, inObject: observer)
@@ -540,8 +540,8 @@ public final class ManagedObjectListController<T: NSManagedObject> {
var error: NSError?
if !fetchedResultsController.performFetch(&error) {
HardcoreData.handleError(
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
error ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to perform fetch on <\(NSFetchedResultsController.self)>.")
}
}

View File

@@ -1,6 +1,6 @@
//
// ManagedObjectListObserver.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -32,7 +32,7 @@ import CoreData
/**
Implement the `ManagedObjectListChangeObserver` protocol to observe changes to a list of `NSManagedObject`'s. `ManagedObjectListChangeObserver`'s may register themselves to a `ManagedObjectListController`'s `addObserver(_:)` method:
let listController = HardcoreData.observeObjectList(
let listController = CoreStore.observeObjectList(
From(MyPersonEntity),
OrderBy(.Ascending("lastName"))
)
@@ -66,7 +66,7 @@ public protocol ManagedObjectListChangeObserver: class {
/**
Implement the `ManagedObjectListObjectObserver` protocol to observe detailed changes to a list's object. `ManagedObjectListObjectObserver`'s may register themselves to a `ManagedObjectListController`'s `addObserver(_:)` method:
let listController = HardcoreData.observeObjectList(
let listController = CoreStore.observeObjectList(
From(MyPersonEntity),
OrderBy(.Ascending("lastName"))
)
@@ -118,7 +118,7 @@ public protocol ManagedObjectListObjectObserver: ManagedObjectListChangeObserver
/**
Implement the `ManagedObjectListSectionObserver` protocol to observe changes to a list's section info. `ManagedObjectListSectionObserver`'s may register themselves to a `ManagedObjectListController`'s `addObserver(_:)` method:
let listController = HardcoreData.observeSectionedList(
let listController = CoreStore.observeSectionedList(
From(MyPersonEntity),
SectionedBy("age") { "Age \($0)" },
OrderBy(.Ascending("lastName"))

View File

@@ -1,6 +1,6 @@
//
// ManagedObjectObserver.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -32,7 +32,7 @@ import CoreData
/**
Implement the `ManagedObjectObserver` protocol to observe changes to a single `NSManagedObject` instance. `ManagedObjectObserver`'s may register themselves to a `ManagedObjectController`'s `addObserver(_:)` method:
let objectController = HardcoreData.observeObject(object)
let objectController = CoreStore.observeObject(object)
objectController.addObserver(self)
*/
public protocol ManagedObjectObserver: class {

View File

@@ -1,6 +1,6 @@
//
// AsynchronousDataTransaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -31,7 +31,7 @@ import GCDKit
// MARK: - AsynchronousDataTransaction
/**
The `AsynchronousDataTransaction` provides an interface for `NSManagedObject` creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from `DataStack.beginAsynchronous(_:)`, or from `HardcoreData.beginAsynchronous(_:)`.
The `AsynchronousDataTransaction` provides an interface for `NSManagedObject` creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from `DataStack.beginAsynchronous(_:)`, or from `CoreStore.beginAsynchronous(_:)`.
*/
public final class AsynchronousDataTransaction: BaseDataTransaction {
@@ -44,8 +44,8 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public func commit(completion: (result: SaveResult) -> Void) {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
HardcoreData.assert(!self.isCommitted, "Attempted to commit a \(typeName(self)) more than once.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
CoreStore.assert(!self.isCommitted, "Attempted to commit a \(typeName(self)) more than once.")
self.isCommitted = true
let semaphore = GCDSemaphore(0)
@@ -63,8 +63,8 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public func commit() {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
HardcoreData.assert(!self.isCommitted, "Attempted to commit a \(typeName(self)) more than once.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
CoreStore.assert(!self.isCommitted, "Attempted to commit a \(typeName(self)) more than once.")
self.isCommitted = true
self.result = self.context.saveSynchronously()
@@ -78,8 +78,8 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to begin a child transaction from a \(typeName(self)) outside its designated queue.")
HardcoreData.assert(!self.isCommitted, "Attempted to begin a child transaction from an already committed \(typeName(self)).")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to begin a child transaction from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(!self.isCommitted, "Attempted to begin a child transaction from an already committed \(typeName(self)).")
return SynchronousDataTransaction(
mainContext: self.context,
@@ -98,7 +98,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public override func create<T: NSManagedObject>(into: Into<T>) -> T {
HardcoreData.assert(!self.isCommitted, "Attempted to create an entity of type <\(T.self)> from an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to create an entity of type <\(T.self)> from an already committed \(typeName(self)).")
return super.create(into)
}
@@ -111,7 +111,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public override func fetch<T: NSManagedObject>(object: T?) -> T? {
HardcoreData.assert(!self.isCommitted, "Attempted to update an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to update an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
return super.fetch(object)
}
@@ -123,7 +123,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public override func delete(object: NSManagedObject?) {
HardcoreData.assert(!self.isCommitted, "Attempted to delete an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to delete an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
super.delete(object)
}
@@ -133,7 +133,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
*/
public override func rollback() {
HardcoreData.assert(!self.isCommitted, "Attempted to rollback an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to rollback an already committed \(typeName(self)).")
super.rollback()
}
@@ -155,7 +155,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
self.closure(transaction: self)
if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the \(typeName(self)) completed without being committed. All changes made within the transaction were discarded.")
CoreStore.log(.Warning, message: "The closure for the \(typeName(self)) completed without being committed. All changes made within the transaction were discarded.")
}
}
}
@@ -167,7 +167,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
self.closure(transaction: self)
if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the \(typeName(self)) completed without being committed. All changes made within the transaction were discarded.")
CoreStore.log(.Warning, message: "The closure for the \(typeName(self)) completed without being committed. All changes made within the transaction were discarded.")
}
}
return self.result

View File

@@ -1,6 +1,6 @@
//
// BaseDataTransaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -133,7 +133,7 @@ public /*abstract*/ class BaseDataTransaction {
*/
public func create<T: NSManagedObject>(into: Into<T>) -> T {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to create an entity of type <\(T.self)> outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to create an entity of type <\(T.self)> outside its designated queue.")
let context = self.context
let object = T.createInContext(context)
@@ -146,10 +146,10 @@ public /*abstract*/ class BaseDataTransaction {
context.assignObject(object, toPersistentStore: persistentStore)
case (.None, true):
HardcoreData.assert(false, "Attempted to create an entity of type \(typeName(object)) with ambiguous destination persistent store, but the configuration name was not specified.")
CoreStore.assert(false, "Attempted to create an entity of type \(typeName(object)) with ambiguous destination persistent store, but the configuration name was not specified.")
default:
HardcoreData.assert(false, "Attempted to create an entity of type \(typeName(object)), but a destination persistent store containing the entity type could not be found.")
CoreStore.assert(false, "Attempted to create an entity of type \(typeName(object)), but a destination persistent store containing the entity type could not be found.")
}
}
else {
@@ -162,11 +162,11 @@ public /*abstract*/ class BaseDataTransaction {
default:
if let configuration = into.configuration {
HardcoreData.assert(false, "Attempted to create an entity of type \(typeName(object)) into the configuration \"\(configuration)\", which it doesn't belong to.")
CoreStore.assert(false, "Attempted to create an entity of type \(typeName(object)) into the configuration \"\(configuration)\", which it doesn't belong to.")
}
else {
HardcoreData.assert(false, "Attempted to create an entity of type \(typeName(object)) into the default configuration, which it doesn't belong to.")
CoreStore.assert(false, "Attempted to create an entity of type \(typeName(object)) into the default configuration, which it doesn't belong to.")
}
}
}
@@ -182,7 +182,7 @@ public /*abstract*/ class BaseDataTransaction {
*/
public func fetch<T: NSManagedObject>(object: T?) -> T? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to update an entity of type \(typeName(object)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to update an entity of type \(typeName(object)) outside its designated queue.")
return object?.inContext(self.context)
}
@@ -194,7 +194,7 @@ public /*abstract*/ class BaseDataTransaction {
*/
public func delete(object: NSManagedObject?) {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to delete an entity of type \(typeName(object)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to delete an entity of type \(typeName(object)) outside its designated queue.")
object?.inContext(self.context)?.deleteFromContext()
}
@@ -206,7 +206,7 @@ public /*abstract*/ class BaseDataTransaction {
*/
public func rollback() {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to rollback a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to rollback a \(typeName(self)) outside its designated queue.")
self.context.reset()
}
@@ -216,7 +216,7 @@ public /*abstract*/ class BaseDataTransaction {
internal let context: NSManagedObjectContext
internal let transactionQueue: GCDQueue
internal let childTransactionQueue: GCDQueue = .createSerial("com.hardcoredata.datastack.childtransactionqueue")
internal let childTransactionQueue: GCDQueue = .createSerial("com.corestore.datastack.childtransactionqueue")
internal var isCommitted = false
internal var result: SaveResult?

View File

@@ -1,6 +1,6 @@
//
// HardcoreData+Transaction.swift
// HardcoreData
// CoreStore+Transaction.swift
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -26,9 +26,9 @@
import Foundation
// MARK: - HardcoreData
// MARK: - CoreStore
public extension HardcoreData {
public extension CoreStore {
// MARK: Public

View File

@@ -1,6 +1,6 @@
//
// DataStack+Transaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -41,7 +41,7 @@ public extension DataStack {
*/
public func beginAsynchronous(closure: (transaction: AsynchronousDataTransaction) -> Void) {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
AsynchronousDataTransaction(
mainContext: self.rootSavingContext,
@@ -57,7 +57,7 @@ public extension DataStack {
*/
public func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
return SynchronousDataTransaction(
mainContext: self.rootSavingContext,
@@ -72,10 +72,10 @@ public extension DataStack {
*/
public func beginDetached() -> DetachedDataTransaction {
HardcoreData.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
return DetachedDataTransaction(
mainContext: self.rootSavingContext,
queue: .Main)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// DetachedDataTransaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -43,7 +43,7 @@ public final class DetachedDataTransaction: BaseDataTransaction {
*/
public func commit(completion: (result: SaveResult) -> Void) {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
self.context.saveAsynchronouslyWithCompletion { (result) -> Void in

View File

@@ -1,6 +1,6 @@
//
// SaveResult.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -32,7 +32,7 @@ import Foundation
The `SaveResult` indicates the result of a `commit(...)` for a transaction.
The `SaveResult` can be treated as a boolean:
HardcoreData.beginAsynchronous { transaction in
CoreStore.beginAsynchronous { transaction in
// ...
let result = transaction.commit()
if result {
@@ -45,7 +45,7 @@ The `SaveResult` can be treated as a boolean:
or as an `enum`, where the resulting associated object can also be inspected:
HardcoreData.beginAsynchronous { transaction in
CoreStore.beginAsynchronous { transaction in
// ...
let result = transaction.commit()
switch result {
@@ -84,15 +84,15 @@ public enum SaveResult {
self = .Failure(error)
}
internal init(_ errorCode: HardcoreDataErrorCode) {
internal init(_ errorCode: CoreStoreErrorCode) {
self.init(errorCode, userInfo: nil)
}
internal init(_ errorCode: HardcoreDataErrorCode, userInfo: [NSObject: AnyObject]?) {
internal init(_ errorCode: CoreStoreErrorCode, userInfo: [NSObject: AnyObject]?) {
self.init(NSError(
hardcoreDataErrorCode: errorCode,
coreStoreErrorCode: errorCode,
userInfo: userInfo))
}
}

View File

@@ -1,6 +1,6 @@
//
// SynchronousDataTransaction.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -31,7 +31,7 @@ import GCDKit
// MARK: - SynchronousDataTransaction
/**
The `SynchronousDataTransaction` provides an interface for `NSManagedObject` creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from `DataStack.beginSynchronous(_:)`, or from `HardcoreData.beginSynchronous(_:)`.
The `SynchronousDataTransaction` provides an interface for `NSManagedObject` creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from `DataStack.beginSynchronous(_:)`, or from `CoreStore.beginSynchronous(_:)`.
*/
public final class SynchronousDataTransaction: BaseDataTransaction {
@@ -42,8 +42,8 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
*/
public func commit() {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
HardcoreData.assert(!self.isCommitted, "Attempted to commit a \(typeName(self)) more than once.")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to commit a \(typeName(self)) outside its designated queue.")
CoreStore.assert(!self.isCommitted, "Attempted to commit a \(typeName(self)) more than once.")
self.isCommitted = true
self.result = self.context.saveSynchronously()
@@ -57,8 +57,8 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
*/
public func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
HardcoreData.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to begin a child transaction from a \(typeName(self)) outside its designated queue.")
HardcoreData.assert(!self.isCommitted, "Attempted to begin a child transaction from an already committed \(typeName(self)).")
CoreStore.assert(self.transactionQueue.isCurrentExecutionContext(), "Attempted to begin a child transaction from a \(typeName(self)) outside its designated queue.")
CoreStore.assert(!self.isCommitted, "Attempted to begin a child transaction from an already committed \(typeName(self)).")
return SynchronousDataTransaction(
mainContext: self.context,
@@ -77,7 +77,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
*/
public override func create<T: NSManagedObject>(into: Into<T>) -> T {
HardcoreData.assert(!self.isCommitted, "Attempted to create an entity of type <\(T.self)> from an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to create an entity of type <\(T.self)> from an already committed \(typeName(self)).")
return super.create(into)
}
@@ -90,7 +90,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
*/
public override func fetch<T: NSManagedObject>(object: T?) -> T? {
HardcoreData.assert(!self.isCommitted, "Attempted to update an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to update an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
return super.fetch(object)
}
@@ -102,7 +102,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
*/
public override func delete(object: NSManagedObject?) {
HardcoreData.assert(!self.isCommitted, "Attempted to delete an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to delete an entity of type \(typeName(object)) from an already committed \(typeName(self)).")
super.delete(object)
}
@@ -112,7 +112,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
*/
public override func rollback() {
HardcoreData.assert(!self.isCommitted, "Attempted to rollback an already committed \(typeName(self)).")
CoreStore.assert(!self.isCommitted, "Attempted to rollback an already committed \(typeName(self)).")
super.rollback()
}
@@ -127,7 +127,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
self.closure(transaction: self)
if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the \(typeName(self)) completed without being committed. All changes made within the transaction were discarded.")
CoreStore.log(.Warning, message: "The closure for the \(typeName(self)) completed without being committed. All changes made within the transaction were discarded.")
}
}
return self.result

View File

@@ -1,6 +1,6 @@
//
// HardcoreData+Setup.swift
// HardcoreData
// CoreStore+Setup.swift
// CoreStore
//
// Copyright (c) 2015 John Rommel Estropia
//
@@ -28,9 +28,9 @@ import CoreData
import GCDKit
// MARK: - HardcoreData
// MARK: - CoreStore
public extension HardcoreData {
public extension CoreStore {
/**
Adds an in-memory store to the `defaultStack`.
@@ -81,4 +81,4 @@ public extension HardcoreData {
)
}
}
}

View File

@@ -1,6 +1,6 @@
//
// DataStack.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -52,7 +52,7 @@ public final class DataStack {
public convenience init() {
let mergedModel: NSManagedObjectModel! = NSManagedObjectModel.mergedModelFromBundles(NSBundle.allBundles())
HardcoreData.assert(mergedModel != nil, "Could not create a merged <\(NSManagedObjectModel.self)> from all bundles.")
CoreStore.assert(mergedModel != nil, "Could not create a merged <\(NSManagedObjectModel.self)> from all bundles.")
self.init(managedObjectModel: mergedModel)
}
@@ -65,10 +65,10 @@ public final class DataStack {
public convenience init(modelName: String) {
let modelFilePath: String! = NSBundle.mainBundle().pathForResource(modelName, ofType: "momd")
HardcoreData.assert(modelFilePath != nil, "Could not find a \"momd\" resource from the main bundle.")
CoreStore.assert(modelFilePath != nil, "Could not find a \"momd\" resource from the main bundle.")
let managedObjectModel: NSManagedObjectModel! = NSManagedObjectModel(contentsOfURL: NSURL(fileURLWithPath: modelFilePath)!)
HardcoreData.assert(managedObjectModel != nil, "Could not create an <\(NSManagedObjectModel.self)> from the resource at path \"\(modelFilePath)\".")
CoreStore.assert(managedObjectModel != nil, "Could not create an <\(NSManagedObjectModel.self)> from the resource at path \"\(modelFilePath)\".")
self.init(managedObjectModel: managedObjectModel)
}
@@ -131,15 +131,15 @@ public final class DataStack {
if let error = error {
HardcoreData.handleError(
CoreStore.handleError(
error,
"Failed to add in-memory <\(NSPersistentStore.self)>.")
return PersistentStoreResult(error)
}
else {
HardcoreData.handleError(
NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
NSError(coreStoreErrorCode: .UnknownError),
"Failed to add in-memory <\(NSPersistentStore.self)>.")
return PersistentStoreResult(.UnknownError)
}
@@ -190,8 +190,8 @@ public final class DataStack {
return PersistentStoreResult(store)
}
HardcoreData.handleError(
NSError(hardcoreDataErrorCode: .DifferentPersistentStoreExistsAtURL),
CoreStore.handleError(
NSError(coreStoreErrorCode: .DifferentPersistentStoreExistsAtURL),
"Failed to add SQLite <\(NSPersistentStore.self)> at \"\(fileURL)\" because a different <\(NSPersistentStore.self)> at that URL already exists.")
return PersistentStoreResult(.DifferentPersistentStoreExistsAtURL)
@@ -205,8 +205,8 @@ public final class DataStack {
attributes: nil,
error: &directoryError) {
HardcoreData.handleError(
directoryError ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
directoryError ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to create directory for SQLite store at \"\(fileURL)\".")
return PersistentStoreResult(directoryError!)
}
@@ -268,8 +268,8 @@ public final class DataStack {
}
}
HardcoreData.handleError(
persistentStoreError ?? NSError(hardcoreDataErrorCode: .UnknownError),
CoreStore.handleError(
persistentStoreError ?? NSError(coreStoreErrorCode: .UnknownError),
"Failed to add SQLite <\(NSPersistentStore.self)> at \"\(fileURL)\".")
return PersistentStoreResult(.UnknownError)
@@ -280,7 +280,7 @@ public final class DataStack {
internal let rootSavingContext: NSManagedObjectContext
internal let mainContext: NSManagedObjectContext
internal let childTransactionQueue: GCDQueue = .createSerial("com.hardcoredata.datastack.childtransactionqueue")
internal let childTransactionQueue: GCDQueue = .createSerial("com.corestore.datastack.childtransactionqueue")
internal func entityNameForEntityClass(entityClass: NSManagedObject.Type) -> String? {
@@ -344,7 +344,7 @@ public final class DataStack {
private let coordinator: NSPersistentStoreCoordinator
private let entityNameMapping: [EntityClassNameType: EntityNameType]
private let storeMetadataUpdateQueue = GCDQueue.createConcurrent("com.hardcoreData.persistentStoreBarrierQueue")
private let storeMetadataUpdateQueue = GCDQueue.createConcurrent("com.coreStore.persistentStoreBarrierQueue")
private var configurationStoreMapping = [ConfigurationNameType: NSPersistentStore]()
private var entityConfigurationsMapping = [EntityClassNameType: Set<String>]()

View File

@@ -1,6 +1,6 @@
//
// PersistentStoreResult.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -33,7 +33,7 @@ import CoreData
The `PersistentStoreResult` indicates the result of initializing the persistent store.
The `PersistentStoreResult` can be treated as a boolean:
let result = HardcoreData.addSQLiteStore()
let result = CoreStore.addSQLiteStore()
if result {
// succeeded
}
@@ -43,7 +43,7 @@ The `PersistentStoreResult` can be treated as a boolean:
or as an `enum`, where the resulting associated object can also be inspected:
let result = HardcoreData.addSQLiteStore()
let result = CoreStore.addSQLiteStore()
switch result {
case .Success(let persistentStore):
// persistentStore is the related NSPersistentStore instance
@@ -79,15 +79,15 @@ public enum PersistentStoreResult {
self = .Failure(error)
}
internal init(_ errorCode: HardcoreDataErrorCode) {
internal init(_ errorCode: CoreStoreErrorCode) {
self.init(errorCode, userInfo: nil)
}
internal init(_ errorCode: HardcoreDataErrorCode, userInfo: [NSObject: AnyObject]?) {
internal init(_ errorCode: CoreStoreErrorCode, userInfo: [NSObject: AnyObject]?) {
self.init(NSError(
hardcoreDataErrorCode: errorCode,
coreStoreErrorCode: errorCode,
userInfo: userInfo))
}
}

View File

@@ -17,14 +17,14 @@
B52977E11B120F8A003D50A5 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B52977E01B120F8A003D50A5 /* CoreLocation.framework */; };
B52977E41B121635003D50A5 /* Place.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52977E31B121635003D50A5 /* Place.swift */; };
B54AAD4F1AF4D26E00848AE0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD4E1AF4D26E00848AE0 /* AppDelegate.swift */; };
B54AAD521AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD501AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld */; };
B54AAD521AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B54AAD501AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodeld */; };
B54AAD591AF4D26E00848AE0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B54AAD571AF4D26E00848AE0 /* Main.storyboard */; };
B54AAD5B1AF4D26E00848AE0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B54AAD5A1AF4D26E00848AE0 /* Images.xcassets */; };
B54AAD5E1AF4D26E00848AE0 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B54AAD5C1AF4D26E00848AE0 /* LaunchScreen.xib */; };
B566E32A1B117B1F00F4F0C6 /* StackSetupDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B566E3291B117B1F00F4F0C6 /* StackSetupDemoViewController.swift */; };
B566E3321B11DF3200F4F0C6 /* UserAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = B566E3311B11DF3200F4F0C6 /* UserAccount.swift */; };
B583A9201AF5F542001F76AF /* HardcoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B583A91B1AF5F4F4001F76AF /* HardcoreData.framework */; };
B583A9211AF5F542001F76AF /* HardcoreData.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B583A91B1AF5F4F4001F76AF /* HardcoreData.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B583A9201AF5F542001F76AF /* CoreStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B583A91B1AF5F4F4001F76AF /* CoreStore.framework */; };
B583A9211AF5F542001F76AF /* CoreStore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B583A91B1AF5F4F4001F76AF /* CoreStore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B5E7240F1B11F993006FB83F /* TwitterAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E7240E1B11F993006FB83F /* TwitterAccount.swift */; };
B5E724111B11F994006FB83F /* FacebookAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E724101B11F994006FB83F /* FacebookAccount.swift */; };
/* End PBXBuildFile section */
@@ -32,31 +32,31 @@
/* Begin PBXContainerItemProxy section */
B583A91A1AF5F4F4001F76AF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */;
containerPortal = B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2F03A53019C5C6DA005002A5;
remoteInfo = HardcoreData;
remoteInfo = CoreStore;
};
B583A91C1AF5F4F4001F76AF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */;
containerPortal = B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2F03A53B19C5C6DA005002A5;
remoteInfo = HardcoreDataTests;
remoteInfo = CoreStoreTests;
};
B583A91E1AF5F512001F76AF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */;
containerPortal = B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 2F03A52F19C5C6DA005002A5;
remoteInfo = HardcoreData;
remoteInfo = CoreStore;
};
B583A9221AF5F542001F76AF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */;
containerPortal = B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 2F03A52F19C5C6DA005002A5;
remoteInfo = HardcoreData;
remoteInfo = CoreStore;
};
/* End PBXContainerItemProxy section */
@@ -67,7 +67,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
B583A9211AF5F542001F76AF /* HardcoreData.framework in Embed Frameworks */,
B583A9211AF5F542001F76AF /* CoreStore.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -84,17 +84,17 @@
B52977DE1B120F83003D50A5 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
B52977E01B120F8A003D50A5 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
B52977E31B121635003D50A5 /* Place.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Place.swift; sourceTree = "<group>"; };
B54AAD491AF4D26E00848AE0 /* HardcoreDataDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HardcoreDataDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
B54AAD491AF4D26E00848AE0 /* CoreStoreDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreStoreDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
B54AAD4D1AF4D26E00848AE0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B54AAD4E1AF4D26E00848AE0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B54AAD511AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = HardcoreDataDemo.xcdatamodel; sourceTree = "<group>"; };
B54AAD511AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = CoreStoreDemo.xcdatamodel; sourceTree = "<group>"; };
B54AAD581AF4D26E00848AE0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
B54AAD5A1AF4D26E00848AE0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
B54AAD5D1AF4D26E00848AE0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
B566E3291B117B1F00F4F0C6 /* StackSetupDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackSetupDemoViewController.swift; sourceTree = "<group>"; };
B566E3311B11DF3200F4F0C6 /* UserAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAccount.swift; sourceTree = "<group>"; };
B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = HardcoreData.xcodeproj; path = ../HardcoreData.xcodeproj; sourceTree = "<group>"; };
B583A9251AF5F547001F76AF /* GCDKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = GCDKit.framework; path = "/Users/johnestropia/Library/Developer/Xcode/DerivedData/HardcoreDataDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos/GCDKit.framework"; sourceTree = "<absolute>"; };
B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CoreStore.xcodeproj; path = ../CoreStore.xcodeproj; sourceTree = "<group>"; };
B583A9251AF5F547001F76AF /* GCDKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = GCDKit.framework; path = "/Users/johnestropia/Library/Developer/Xcode/DerivedData/CoreStoreDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos/GCDKit.framework"; sourceTree = "<absolute>"; };
B5E7240E1B11F993006FB83F /* TwitterAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TwitterAccount.swift; sourceTree = "<group>"; };
B5E724101B11F994006FB83F /* FacebookAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FacebookAccount.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -106,7 +106,7 @@
files = (
B52977E11B120F8A003D50A5 /* CoreLocation.framework in Frameworks */,
B52977DF1B120F83003D50A5 /* MapKit.framework in Frameworks */,
B583A9201AF5F542001F76AF /* HardcoreData.framework in Frameworks */,
B583A9201AF5F542001F76AF /* CoreStore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -137,7 +137,7 @@
B52977E21B120F90003D50A5 /* Frameworks */ = {
isa = PBXGroup;
children = (
B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */,
B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */,
B52977E01B120F8A003D50A5 /* CoreLocation.framework */,
B52977DE1B120F83003D50A5 /* MapKit.framework */,
B583A9251AF5F547001F76AF /* GCDKit.framework */,
@@ -149,7 +149,7 @@
isa = PBXGroup;
children = (
B52977E21B120F90003D50A5 /* Frameworks */,
B54AAD4B1AF4D26E00848AE0 /* HardcoreDataDemo */,
B54AAD4B1AF4D26E00848AE0 /* CoreStoreDemo */,
B54AAD4A1AF4D26E00848AE0 /* Products */,
);
sourceTree = "<group>";
@@ -157,12 +157,12 @@
B54AAD4A1AF4D26E00848AE0 /* Products */ = {
isa = PBXGroup;
children = (
B54AAD491AF4D26E00848AE0 /* HardcoreDataDemo.app */,
B54AAD491AF4D26E00848AE0 /* CoreStoreDemo.app */,
);
name = Products;
sourceTree = "<group>";
};
B54AAD4B1AF4D26E00848AE0 /* HardcoreDataDemo */ = {
B54AAD4B1AF4D26E00848AE0 /* CoreStoreDemo */ = {
isa = PBXGroup;
children = (
B54AAD4E1AF4D26E00848AE0 /* AppDelegate.swift */,
@@ -172,10 +172,10 @@
B54AAD571AF4D26E00848AE0 /* Main.storyboard */,
B54AAD5A1AF4D26E00848AE0 /* Images.xcassets */,
B54AAD5C1AF4D26E00848AE0 /* LaunchScreen.xib */,
B54AAD501AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld */,
B54AAD501AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodeld */,
B54AAD4C1AF4D26E00848AE0 /* Supporting Files */,
);
path = HardcoreDataDemo;
path = CoreStoreDemo;
sourceTree = "<group>";
};
B54AAD4C1AF4D26E00848AE0 /* Supporting Files */ = {
@@ -200,8 +200,8 @@
B583A9151AF5F4F3001F76AF /* Products */ = {
isa = PBXGroup;
children = (
B583A91B1AF5F4F4001F76AF /* HardcoreData.framework */,
B583A91D1AF5F4F4001F76AF /* HardcoreDataTests.xctest */,
B583A91B1AF5F4F4001F76AF /* CoreStore.framework */,
B583A91D1AF5F4F4001F76AF /* CoreStoreTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -209,9 +209,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
B54AAD481AF4D26E00848AE0 /* HardcoreDataDemo */ = {
B54AAD481AF4D26E00848AE0 /* CoreStoreDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = B54AAD6D1AF4D26E00848AE0 /* Build configuration list for PBXNativeTarget "HardcoreDataDemo" */;
buildConfigurationList = B54AAD6D1AF4D26E00848AE0 /* Build configuration list for PBXNativeTarget "CoreStoreDemo" */;
buildPhases = (
B54AAD451AF4D26E00848AE0 /* Sources */,
B54AAD461AF4D26E00848AE0 /* Frameworks */,
@@ -224,9 +224,9 @@
B583A91F1AF5F512001F76AF /* PBXTargetDependency */,
B583A9231AF5F542001F76AF /* PBXTargetDependency */,
);
name = HardcoreDataDemo;
productName = HardcoreDataDemo;
productReference = B54AAD491AF4D26E00848AE0 /* HardcoreDataDemo.app */;
name = CoreStoreDemo;
productName = CoreStoreDemo;
productReference = B54AAD491AF4D26E00848AE0 /* CoreStoreDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -243,7 +243,7 @@
};
};
};
buildConfigurationList = B54AAD441AF4D26E00848AE0 /* Build configuration list for PBXProject "HardcoreDataDemo" */;
buildConfigurationList = B54AAD441AF4D26E00848AE0 /* Build configuration list for PBXProject "CoreStoreDemo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
@@ -257,28 +257,28 @@
projectReferences = (
{
ProductGroup = B583A9151AF5F4F3001F76AF /* Products */;
ProjectRef = B583A9141AF5F4F3001F76AF /* HardcoreData.xcodeproj */;
ProjectRef = B583A9141AF5F4F3001F76AF /* CoreStore.xcodeproj */;
},
);
projectRoot = "";
targets = (
B54AAD481AF4D26E00848AE0 /* HardcoreDataDemo */,
B54AAD481AF4D26E00848AE0 /* CoreStoreDemo */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
B583A91B1AF5F4F4001F76AF /* HardcoreData.framework */ = {
B583A91B1AF5F4F4001F76AF /* CoreStore.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = HardcoreData.framework;
path = CoreStore.framework;
remoteRef = B583A91A1AF5F4F4001F76AF /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B583A91D1AF5F4F4001F76AF /* HardcoreDataTests.xctest */ = {
B583A91D1AF5F4F4001F76AF /* CoreStoreTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = HardcoreDataTests.xctest;
path = CoreStoreTests.xctest;
remoteRef = B583A91C1AF5F4F4001F76AF /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
@@ -310,7 +310,7 @@
B5E724111B11F994006FB83F /* FacebookAccount.swift in Sources */,
B5E7240F1B11F993006FB83F /* TwitterAccount.swift in Sources */,
B566E3321B11DF3200F4F0C6 /* UserAccount.swift in Sources */,
B54AAD521AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld in Sources */,
B54AAD521AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodeld in Sources */,
B503FAE11AFDC71700F90881 /* Palette.swift in Sources */,
B503FAE21AFDC71700F90881 /* PaletteTableViewCell.swift in Sources */,
B503FADF1AFDC71700F90881 /* ObjectListObserverDemoViewController.swift in Sources */,
@@ -323,12 +323,12 @@
/* Begin PBXTargetDependency section */
B583A91F1AF5F512001F76AF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = HardcoreData;
name = CoreStore;
targetProxy = B583A91E1AF5F512001F76AF /* PBXContainerItemProxy */;
};
B583A9231AF5F542001F76AF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = HardcoreData;
name = CoreStore;
targetProxy = B583A9221AF5F542001F76AF /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@@ -440,9 +440,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/HardcoreDataDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/CoreStoreDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos",
);
INFOPLIST_FILE = HardcoreDataDemo/Info.plist;
INFOPLIST_FILE = CoreStoreDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -455,9 +455,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/HardcoreDataDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/CoreStoreDemo-ftknhsqfpsthfogvisxisgpbbhsj/Build/Products/Debug-iphoneos",
);
INFOPLIST_FILE = HardcoreDataDemo/Info.plist;
INFOPLIST_FILE = CoreStoreDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -467,7 +467,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
B54AAD441AF4D26E00848AE0 /* Build configuration list for PBXProject "HardcoreDataDemo" */ = {
B54AAD441AF4D26E00848AE0 /* Build configuration list for PBXProject "CoreStoreDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B54AAD6B1AF4D26E00848AE0 /* Debug */,
@@ -476,7 +476,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
B54AAD6D1AF4D26E00848AE0 /* Build configuration list for PBXNativeTarget "HardcoreDataDemo" */ = {
B54AAD6D1AF4D26E00848AE0 /* Build configuration list for PBXNativeTarget "CoreStoreDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B54AAD6E1AF4D26E00848AE0 /* Debug */,
@@ -488,13 +488,13 @@
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
B54AAD501AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodeld */ = {
B54AAD501AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
B54AAD511AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodel */,
B54AAD511AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodel */,
);
currentVersion = B54AAD511AF4D26E00848AE0 /* HardcoreDataDemo.xcdatamodel */;
path = HardcoreDataDemo.xcdatamodeld;
currentVersion = B54AAD511AF4D26E00848AE0 /* CoreStoreDemo.xcdatamodel */;
path = CoreStoreDemo.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};

View File

@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:HardcoreDataDemo.xcodeproj">
location = "self:CoreStoreDemo.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>B6855E48-4B19-4321-B1C7-CB2706E12777</string>
<key>IDESourceControlProjectName</key>
<string>CoreStoreDemo</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
<string>github.com:JohnEstropia/CoreStore.git</string>
<key>8B2E522D57154DFA93A06982C36315ECBEA4FA97</key>
<string>github.com:JohnEstropia/GCDKit.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>CoreStoreDemo/CoreStoreDemo.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4B60F1BCB491FF717C56441AE7783C74F417BE48</key>
<string>../../..</string>
<key>8B2E522D57154DFA93A06982C36315ECBEA4FA97</key>
<string>../../../Libraries/GCDKit/</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:JohnEstropia/CoreStore.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>4B60F1BCB491FF717C56441AE7783C74F417BE48</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>4B60F1BCB491FF717C56441AE7783C74F417BE48</string>
<key>IDESourceControlWCCName</key>
<string>CoreStore</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>8B2E522D57154DFA93A06982C36315ECBEA4FA97</string>
<key>IDESourceControlWCCName</key>
<string>GCDKit</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B54AAD481AF4D26E00848AE0"
BuildableName = "CoreStoreDemo.app"
BlueprintName = "CoreStoreDemo"
ReferencedContainer = "container:CoreStoreDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B54AAD481AF4D26E00848AE0"
BuildableName = "CoreStoreDemo.app"
BlueprintName = "CoreStoreDemo"
ReferencedContainer = "container:CoreStoreDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B54AAD481AF4D26E00848AE0"
BuildableName = "CoreStoreDemo.app"
BlueprintName = "CoreStoreDemo"
ReferencedContainer = "container:CoreStoreDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B54AAD481AF4D26E00848AE0"
BuildableName = "CoreStoreDemo.app"
BlueprintName = "CoreStoreDemo"
ReferencedContainer = "container:CoreStoreDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CoreStoreDemo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>B54AAD481AF4D26E00848AE0</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@@ -1,6 +1,6 @@
//
// AppDelegate.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/02.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -17,7 +17,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="HardcoreDataDemo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CoreStoreDemo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>

View File

@@ -9,7 +9,7 @@
<!--SNS Accounts-->
<scene sceneID="3If-81-mNf">
<objects>
<tableViewController id="AW4-lY-JNk" customClass="StackSetupDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController id="AW4-lY-JNk" customClass="StackSetupDemoViewController" customModule="CoreStoreDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="S3A-lm-AuA">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -87,7 +87,7 @@
</objects>
<point key="canvasLocation" x="3694" y="650"/>
</scene>
<!--HardcoreData Demos-->
<!--CoreStore Demos-->
<scene sceneID="0Be-vc-h1W">
<objects>
<tableViewController id="t0d-B0-B7U" sceneMemberID="viewController">
@@ -215,7 +215,7 @@
<outlet property="delegate" destination="t0d-B0-B7U" id="Yta-gX-xFD"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="HardcoreData Demos" id="3bj-zE-UYZ"/>
<navigationItem key="navigationItem" title="CoreStore Demos" id="3bj-zE-UYZ"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Xgp-Zn-Sbp" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
@@ -224,7 +224,7 @@
<!--Object Observer-->
<scene sceneID="Y7v-tc-8cX">
<objects>
<viewController automaticallyAdjustsScrollViewInsets="NO" id="dX3-kR-CYC" customClass="ObjectObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<viewController automaticallyAdjustsScrollViewInsets="NO" id="dX3-kR-CYC" customClass="ObjectObserverDemoViewController" customModule="CoreStoreDemo" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="J6W-Ki-cRQ"/>
<viewControllerLayoutGuide type="bottom" id="aI4-O3-OCi"/>
@@ -348,7 +348,7 @@
<!--Colors-->
<scene sceneID="3lD-lX-hIc">
<objects>
<viewController automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="YOI-b7-Nxn" customClass="ObserversViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<viewController automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="YOI-b7-Nxn" customClass="ObserversViewController" customModule="CoreStoreDemo" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="IML-3o-caw"/>
<viewControllerLayoutGuide type="bottom" id="LNL-mj-D7l"/>
@@ -412,12 +412,12 @@
<!--List Observer-->
<scene sceneID="gkX-bd-Rel">
<objects>
<tableViewController id="3AE-ED-0oj" customClass="ObjectListObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController id="3AE-ED-0oj" customClass="ObjectListObserverDemoViewController" customModule="CoreStoreDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="DAz-BE-6Ca">
<rect key="frame" x="0.0" y="0.0" width="600" height="268"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="G3X-70-BCD" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="G3X-70-BCD" customClass="PaletteTableViewCell" customModule="CoreStoreDemo" customModuleProvider="target">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="G3X-70-BCD" id="aT8-nz-i5l">
<autoresizingMask key="autoresizingMask"/>
@@ -469,13 +469,13 @@
<!--List Observer-->
<scene sceneID="iDB-TD-It9">
<objects>
<tableViewController id="lCE-i6-UCT" customClass="ObjectListObserverDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController id="lCE-i6-UCT" customClass="ObjectListObserverDemoViewController" customModule="CoreStoreDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Zba-8M-Zd7">
<rect key="frame" x="0.0" y="0.0" width="600" height="268"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="zSO-3e-OVq" customClass="PaletteTableViewCell" customModule="HardcoreDataDemo" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="PaletteTableViewCell" id="zSO-3e-OVq" customClass="PaletteTableViewCell" customModule="CoreStoreDemo" customModuleProvider="target">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zSO-3e-OVq" id="cHA-by-n4b">
<autoresizingMask key="autoresizingMask"/>
@@ -551,7 +551,7 @@
<!--Placemark-->
<scene sceneID="LRD-q1-hw1">
<objects>
<viewController id="jPl-fH-NlD" customClass="TransactionsDemoViewController" customModule="HardcoreDataDemo" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="jPl-fH-NlD" customClass="TransactionsDemoViewController" customModule="CoreStoreDemo" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="1of-hY-qOU"/>
<viewControllerLayoutGuide type="bottom" id="RZg-hi-T8O"/>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="7701" systemVersion="14D136" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Palette" representedClassName="HardcoreDataDemo.Palette">
<entity name="Palette" representedClassName="CoreStoreDemo.Palette">
<attribute name="brightness" optional="YES" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="colorName" optional="YES" transient="YES" attributeType="String" syncable="YES"/>
<attribute name="hue" optional="YES" attributeType="Integer 32" defaultValueString="0.0" syncable="YES"/>
<attribute name="saturation" optional="YES" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<userInfo/>
</entity>
<entity name="Place" representedClassName="HardcoreDataDemo.Place" syncable="YES">
<entity name="Place" representedClassName="CoreStoreDemo.Place" syncable="YES">
<attribute name="latitude" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="longitude" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="subtitle" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="title" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="UserAccount" representedClassName="HardcoreDataDemo.UserAccount" syncable="YES">
<entity name="UserAccount" representedClassName="CoreStoreDemo.UserAccount" syncable="YES">
<attribute name="accountType" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="friends" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>

View File

@@ -1,26 +1,26 @@
//
// ObjectListObserverDemoViewController.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/02.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
//
import UIKit
import HardcoreData
import CoreStore
private struct Static {
static let palettes: ManagedObjectListController<Palette> = {
HardcoreData.addSQLiteStore(
CoreStore.addSQLiteStore(
"ColorsDemo.sqlite",
configuration: "ObservingDemo",
resetStoreOnMigrationFailure: true
)
return HardcoreData.observeSectionedList(
return CoreStore.observeSectionedList(
From(Palette),
SectionedBy("colorName"),
OrderBy(.Ascending("hue"))
@@ -121,7 +121,7 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
case .Delete:
let palette = Static.palettes[indexPath]
HardcoreData.beginAsynchronous{ (transaction) -> Void in
CoreStore.beginAsynchronous{ (transaction) -> Void in
transaction.delete(palette)
transaction.commit { (result) -> Void in }
@@ -197,7 +197,7 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
@IBAction dynamic func resetBarButtonItemTouched(sender: AnyObject?) {
HardcoreData.beginAsynchronous { (transaction) -> Void in
CoreStore.beginAsynchronous { (transaction) -> Void in
transaction.deleteAll(From(Palette))
transaction.commit()
@@ -206,7 +206,7 @@ class ObjectListObserverDemoViewController: UITableViewController, ManagedObject
@IBAction dynamic func addBarButtonItemTouched(sender: AnyObject?) {
HardcoreData.beginAsynchronous { (transaction) -> Void in
CoreStore.beginAsynchronous { (transaction) -> Void in
let palette = transaction.create(Into(Palette))
palette.setInitialValues()

View File

@@ -1,13 +1,13 @@
//
// ObjectObserverDemoViewController.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/06.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
//
import UIKit
import HardcoreData
import CoreStore
// MARK: - ObjectObserverDemoViewController
@@ -24,7 +24,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
if let palette = newValue {
self.objectController = HardcoreData.observeObject(palette)
self.objectController = CoreStore.observeObject(palette)
}
else {
@@ -45,13 +45,13 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
required init(coder aDecoder: NSCoder) {
if let palette = HardcoreData.fetchOne(From(Palette), OrderBy(.Ascending("hue"))) {
if let palette = CoreStore.fetchOne(From(Palette), OrderBy(.Ascending("hue"))) {
self.objectController = HardcoreData.observeObject(palette)
self.objectController = CoreStore.observeObject(palette)
}
else {
HardcoreData.beginSynchronous { (transaction) -> Void in
CoreStore.beginSynchronous { (transaction) -> Void in
let palette = transaction.create(Into(Palette))
palette.setInitialValues()
@@ -59,8 +59,8 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
transaction.commit()
}
let palette = HardcoreData.fetchOne(From(Palette), OrderBy(.Ascending("hue")))!
self.objectController = HardcoreData.observeObject(palette)
let palette = CoreStore.fetchOne(From(Palette), OrderBy(.Ascending("hue")))!
self.objectController = CoreStore.observeObject(palette)
}
super.init(coder: aDecoder)
@@ -121,7 +121,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
@IBAction dynamic func hueSliderValueDidChange(sender: AnyObject?) {
let hue = self.hueSlider?.value ?? 0
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController?.object) {
@@ -134,7 +134,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
@IBAction dynamic func saturationSliderValueDidChange(sender: AnyObject?) {
let saturation = self.saturationSlider?.value ?? 0
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController?.object) {
@@ -147,7 +147,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
@IBAction dynamic func brightnessSliderValueDidChange(sender: AnyObject?) {
let brightness = self.brightnessSlider?.value ?? 0
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
if let palette = transaction.fetch(self?.objectController?.object) {
@@ -159,7 +159,7 @@ class ObjectObserverDemoViewController: UIViewController, ManagedObjectObserver
@IBAction dynamic func deleteBarButtonTapped(sender: AnyObject?) {
HardcoreData.beginAsynchronous { [weak self] (transaction) -> Void in
CoreStore.beginAsynchronous { [weak self] (transaction) -> Void in
transaction.delete(self?.objectController?.object)
transaction.commit()

View File

@@ -1,6 +1,6 @@
//
// ObserversViewController.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// Palette.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/05.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
@@ -9,7 +9,7 @@
import Foundation
import UIKit
import CoreData
import HardcoreData
import CoreStore
// MARK: - Palette

View File

@@ -1,6 +1,6 @@
//
// PaletteTableViewCell.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/05.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// FacebookAccount.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -1,13 +1,13 @@
//
// StackSetupDemoViewController.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
//
import UIKit
import HardcoreData
import CoreStore
private struct Static {
@@ -17,7 +17,7 @@ private struct Static {
static let facebookStack: DataStack = {
let dataStack = DataStack(modelName: "HardcoreDataDemo")
let dataStack = DataStack(modelName: "CoreStoreDemo")
dataStack.addSQLiteStore(
"AccountsDemo_FB_John.sqlite",
configuration: johnConfiguration,
@@ -52,7 +52,7 @@ private struct Static {
static let twitterStack: DataStack = {
let dataStack = DataStack(modelName: "HardcoreDataDemo")
let dataStack = DataStack(modelName: "CoreStoreDemo")
dataStack.addSQLiteStore(
"AccountsDemo_TW_John.sqlite",
configuration: johnConfiguration,

View File

@@ -1,6 +1,6 @@
//
// TwitterAccount.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// UserAccount.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// Place.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// TransactionsDemoViewController.swift
// HardcoreDataDemo
// CoreStoreDemo
//
// Created by John Rommel Estropia on 2015/05/24.
// Copyright (c) 2015 John Rommel Estropia. All rights reserved.
@@ -10,7 +10,7 @@ import UIKit
import CoreLocation
import MapKit
import AddressBookUI
import HardcoreData
import CoreStore
import GCDKit
@@ -18,26 +18,26 @@ private struct Static {
static let placeController: ManagedObjectController<Place> = {
HardcoreData.addSQLiteStore(
CoreStore.addSQLiteStore(
"PlaceDemo.sqlite",
configuration: "TransactionsDemo",
resetStoreOnMigrationFailure: true
)
var place = HardcoreData.fetchOne(From(Place))
var place = CoreStore.fetchOne(From(Place))
if place == nil {
HardcoreData.beginSynchronous { (transaction) -> Void in
CoreStore.beginSynchronous { (transaction) -> Void in
let place = transaction.create(Into(Place))
place.setInitialValues()
transaction.commit()
}
place = HardcoreData.fetchOne(From(Place))
place = CoreStore.fetchOne(From(Place))
}
return HardcoreData.observeObject(place!)
return CoreStore.observeObject(place!)
}()
}
@@ -159,7 +159,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Manag
if let mapView = self.mapView, let gesture = sender as? UILongPressGestureRecognizer where gesture.state == .Began {
HardcoreData.beginAsynchronous { (transaction) -> Void in
CoreStore.beginAsynchronous { (transaction) -> Void in
let place = transaction.fetch(Static.placeController.object)
place?.coordinate = mapView.convertPoint(
@@ -173,7 +173,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Manag
@IBAction dynamic func refreshButtonTapped(sender: AnyObject?) {
HardcoreData.beginSynchronous { (transaction) -> Void in
CoreStore.beginSynchronous { (transaction) -> Void in
let place = transaction.fetch(Static.placeController.object)
place?.setInitialValues()
@@ -183,7 +183,7 @@ class TransactionsDemoViewController: UIViewController, MKMapViewDelegate, Manag
func geocodePlace(place: Place) {
let transaction = HardcoreData.beginDetached()
let transaction = CoreStore.beginDetached()
self.geocoder?.cancelGeocode()

View File

@@ -1,6 +1,6 @@
//
// HardcoreDataTests.swift
// HardcoreDataTests
// CoreStoreTests.swift
// CoreStoreTests
//
// Copyright (c) 2014 John Rommel Estropia
//
@@ -25,9 +25,9 @@
import UIKit
import XCTest
import HardcoreData
import CoreStore
class HardcoreDataTests: XCTestCase {
class CoreStoreTests: XCTestCase {
override func setUp() {
@@ -44,8 +44,8 @@ class HardcoreDataTests: XCTestCase {
func testExample() {
let stack = DataStack()
HardcoreData.defaultStack = stack
XCTAssert(HardcoreData.defaultStack === stack, "HardcoreData.defaultStack === stack")
CoreStore.defaultStack = stack
XCTAssert(CoreStore.defaultStack === stack, "CoreStore.defaultStack === stack")
switch stack.addSQLiteStore("ConfigStore1.sqlite", configuration: "Config1", resetStoreOnMigrationFailure: true){
@@ -65,10 +65,10 @@ class HardcoreDataTests: XCTestCase {
break
}
let detachedTransaction = HardcoreData.beginDetached()
let detachedTransaction = CoreStore.beginDetached()
let createExpectation = self.expectationWithDescription("Entity creation")
HardcoreData.beginAsynchronous { (transaction) -> Void in
CoreStore.beginAsynchronous { (transaction) -> Void in
let obj1 = transaction.create(Into(TestEntity1))
obj1.testEntityID = 1
@@ -134,7 +134,7 @@ class HardcoreDataTests: XCTestCase {
transaction.commit { (result) -> Void in
let objs4test = HardcoreData.fetchOne(
let objs4test = CoreStore.fetchOne(
From(TestEntity2),
Where("testEntityID", isEqualTo: 4),
Tweak { (fetchRequest) -> Void in
@@ -161,7 +161,7 @@ class HardcoreDataTests: XCTestCase {
}
let queryExpectation = self.expectationWithDescription("Query creation")
HardcoreData.beginAsynchronous { (transaction) -> Void in
CoreStore.beginAsynchronous { (transaction) -> Void in
let obj1 = transaction.fetchOne(From(TestEntity1))
XCTAssertNotNil(obj1, "obj1 != nil")
@@ -180,7 +180,7 @@ class HardcoreDataTests: XCTestCase {
transaction.commit { (result) -> Void in
let counts = HardcoreData.queryAttributes(
let counts = CoreStore.queryAttributes(
From(TestEntity2),
Select(.Count("testString", As: "count"), "testString"),
GroupBy("testString")
@@ -202,20 +202,20 @@ class HardcoreDataTests: XCTestCase {
self.waitForExpectationsWithTimeout(100, handler: nil)
let max1 = HardcoreData.queryValue(
let max1 = CoreStore.queryValue(
From(TestEntity2),
Select<Int>(.Maximum("testNumber"))
)
XCTAssertTrue(max1 == 100, "max == 100 (actual: \(max1))")
let max2 = HardcoreData.queryValue(
let max2 = CoreStore.queryValue(
From(TestEntity2),
Select<NSNumber>(.Maximum("testNumber")),
Where("%K > %@", "testEntityID", 2)
)
XCTAssertTrue(max2 == 90, "max == 90 (actual: \(max2))")
HardcoreData.beginSynchronous { (transaction) -> Void in
CoreStore.beginSynchronous { (transaction) -> Void in
let numberOfDeletedObjects1 = transaction.deleteAll(From(TestEntity1))
XCTAssertTrue(numberOfDeletedObjects1 == 1, "numberOfDeletedObjects1 == 1 (actual: \(numberOfDeletedObjects1))")
@@ -229,11 +229,11 @@ class HardcoreDataTests: XCTestCase {
transaction.commit()
}
let objs1 = HardcoreData.fetchAll(From(TestEntity1))
let objs1 = CoreStore.fetchAll(From(TestEntity1))
XCTAssertNotNil(objs1, "objs1 != nil")
XCTAssertTrue(objs1?.count == 0, "objs1?.count == 0")
let objs2 = HardcoreData.fetchAll(From(TestEntity2))
let objs2 = CoreStore.fetchAll(From(TestEntity2))
XCTAssertNotNil(objs2, "objs2 != nil")
XCTAssertTrue(objs2?.count == 1, "objs2?.count == 1")
@@ -253,7 +253,7 @@ class HardcoreDataTests: XCTestCase {
case .Success(let hasChanges):
XCTAssertTrue(hasChanges, "hasChanges == true")
let count: Int? = HardcoreData.queryValue(
let count: Int? = CoreStore.queryValue(
From(TestEntity1),
Select(.Count("testNumber"))
)
@@ -273,7 +273,7 @@ class HardcoreDataTests: XCTestCase {
case .Success(let hasChanges):
XCTAssertTrue(hasChanges, "hasChanges == true")
let count = HardcoreData.queryValue(
let count = CoreStore.queryValue(
From(TestEntity1),
Select<Int>(.Count("testNumber"))
)

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="7701" systemVersion="14D136" minimumToolsVersion="Xcode 4.3" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="TestEntity1AAA" representedClassName="HardcoreDataTests.TestEntity1" syncable="YES">
<entity name="TestEntity1AAA" representedClassName="CoreStoreTests.TestEntity1" syncable="YES">
<attribute name="testDate" optional="YES" attributeType="Date" syncable="YES"/>
<attribute name="testEntityID" attributeType="Integer 64" syncable="YES"/>
<attribute name="testNumber" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="testString" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="TestEntity2" representedClassName="HardcoreDataTests.TestEntity2" syncable="YES">
<entity name="TestEntity2" representedClassName="CoreStoreTests.TestEntity2" syncable="YES">
<attribute name="testDate" optional="YES" attributeType="Date" syncable="YES"/>
<attribute name="testEntityID" attributeType="Integer 64" syncable="YES"/>
<attribute name="testNumber" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
@@ -20,6 +20,6 @@
</configuration>
<elements>
<element name="TestEntity1AAA" positionX="-63" positionY="-18" width="128" height="105"/>
<element name="TestEntity2" positionX="-63" positionY="9" width="128" height="103"/>
<element name="TestEntity2" positionX="-63" positionY="9" width="128" height="105"/>
</elements>
</model>

View File

@@ -1,6 +1,6 @@
//
// TestEntity1.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//

View File

@@ -1,6 +1,6 @@
//
// TestEntity1.swift
// HardcoreData
// CoreStore
//
// Copyright (c) 2014 John Rommel Estropia
//

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>HardcoreDataDemo.xcdatamodel</string>
</dict>
</plist>

View File

@@ -1,17 +1,17 @@
# HardcoreData
[![Version](https://img.shields.io/cocoapods/v/HardcoreData.svg?style=flat)](http://cocoadocs.org/docsets/HardcoreData)
[![Platform](https://img.shields.io/cocoapods/p/HardcoreData.svg?style=flat)](http://cocoadocs.org/docsets/HardcoreData)
[![License](https://img.shields.io/cocoapods/l/HardcoreData.svg?style=flat)](http://cocoadocs.org/docsets/HardcoreData)
# CoreStore
[![Version](https://img.shields.io/cocoapods/v/CoreStore.svg?style=flat)](http://cocoadocs.org/docsets/CoreStore)
[![Platform](https://img.shields.io/cocoapods/p/CoreStore.svg?style=flat)](http://cocoadocs.org/docsets/CoreStore)
[![License](https://img.shields.io/cocoapods/l/CoreStore.svg?style=flat)](http://cocoadocs.org/docsets/CoreStore)
Simple, elegant, and smart Core Data programming with Swift
(Swift only, iOS 8+ only)
(Swift, iOS 8+)
## Features
- Supports multiple persistent stores per *data stack*, just the way .xcdatamodeld files are supposed to. HardcoreData will also manage one *data stack* by default, but you can create and manage as many as you need.
- Supports multiple persistent stores per *data stack*, just the way .xcdatamodeld files are supposed to. CoreStore will also manage one *data stack* by default, but you can create and manage as many as you need.
- Ability to plug-in your own logging framework (or any of your favorite 3rd-party logger)
- Gets around a limitation with other Core Data wrappers where the entity name should be the same as the `NSManagedObject` subclass name. HardcoreData loads entity-to-class mappings from the .xcdatamodeld file, so you are free to name them independently.
- Gets around a limitation with other Core Data wrappers where the entity name should be the same as the `NSManagedObject` subclass name. CoreStore loads entity-to-class mappings from the .xcdatamodeld file, so you are free to name them independently.
- Observe a list of `NSManagedObject`'s using `ManagedObjectListController`, a clean wrapper for `NSFetchedResultsController`. Another controller, `ManagedObjectController`, lets you observe changes for a single object without using KVO. Both controllers can have multiple observers as well, so there is no extra overhead when sharing the same data source for multiple screens.
- Makes it hard to fall into common concurrency mistakes. All `NSManagedObjectContext` tasks are encapsulated into safer, higher-level abstractions without sacrificing flexibility and customizability.
- Provides convenient API for common use cases.
@@ -21,12 +21,12 @@ Simple, elegant, and smart Core Data programming with Swift
Quick-setup:
```swift
HardcoreData.addSQLiteStore("MyStore.sqlite")
CoreStore.addSQLiteStore("MyStore.sqlite")
```
Simple transactions:
```swift
HardcoreData.beginAsynchronous { (transaction) -> Void in
CoreStore.beginAsynchronous { (transaction) -> Void in
let object = transaction.create(MyEntity)
object.entityID = 1
object.name = "test entity"
@@ -42,10 +42,10 @@ HardcoreData.beginAsynchronous { (transaction) -> Void in
Easy fetching:
```swift
let objects = HardcoreData.fetchAll(From(MyEntity))
let objects = CoreStore.fetchAll(From(MyEntity))
```
```swift
let objects = HardcoreData.fetchAll(
let objects = CoreStore.fetchAll(
From(MyEntity),
Where("entityID", isEqualTo: 1),
OrderBy(.Ascending("entityID"), .Descending("name")),
@@ -57,7 +57,7 @@ let objects = HardcoreData.fetchAll(
Simple queries:
```swift
let count = HardcoreData.queryValue(
let count = CoreStore.queryValue(
From(MyEntity),
Select<Int>(.Count("entityID"))
)
@@ -77,11 +77,11 @@ let count = HardcoreData.queryValue(
## <a name="architecture">Architecture</a>
For maximum safety and performance, HardcoreData will enforce coding patterns and practices it was designed for. (Don't worry, it's not as scary as it sounds.) But it is advisable to understand the "magic" of HardcoreData before you use it in your apps.
For maximum safety and performance, CoreStore will enforce coding patterns and practices it was designed for. (Don't worry, it's not as scary as it sounds.) But it is advisable to understand the "magic" of CoreStore before you use it in your apps.
If you are already familiar with the inner workings of CoreData, here is a mapping of `HardcoreData` abstractions:
If you are already familiar with the inner workings of CoreData, here is a mapping of `CoreStore` abstractions:
| *Core Data* | *HardcoreData* |
| *Core Data* | *CoreStore* |
| --- | --- |
| `NSManagedObjectModel` / `NSPersistentStoreCoordinator`<br />(.xcdatamodeld file) | `DataStack` |
| `NSPersistentStore`<br />("Configuration"s in the .xcdatamodeld file) | `DataStack` configuration<br />(multiple sqlite / in-memory stores per stack) |
@@ -91,7 +91,7 @@ Popular libraries [RestKit](https://github.com/RestKit/RestKit) and [MagicalReco
<img src="https://cloud.githubusercontent.com/assets/3029684/6734049/40579660-ce99-11e4-9d38-829877386afb.png" alt="nested contexts" height=271 />
This ensures maximum data integrity between contexts without blocking the main queue. But as <a href="http://floriankugler.com/2013/04/29/concurrent-core-data-stack-performance-shootout/">Florian Kugler's investigation</a> found out, merging contexts is still by far faster than saving nested contexts. HardcoreData's `DataStack` takes the best of both worlds by treating the main `NSManagedObjectContext` as a read-only context, and only allows changes to be made within *transactions*:
This ensures maximum data integrity between contexts without blocking the main queue. But as <a href="http://floriankugler.com/2013/04/29/concurrent-core-data-stack-performance-shootout/">Florian Kugler's investigation</a> found out, merging contexts is still by far faster than saving nested contexts. CoreStore's `DataStack` takes the best of both worlds by treating the main `NSManagedObjectContext` as a read-only context, and only allows changes to be made within *transactions*:
<img src="https://cloud.githubusercontent.com/assets/3029684/6734050/4078b642-ce99-11e4-95ea-c0c1d24fbe80.png" alt="nested contexts and merge hybrid" height=212 />
@@ -100,12 +100,12 @@ This allows for a butter-smooth main thread, while still taking advantage of saf
## <a name="setup">Setting up</a>
The simplest way to initialize HardcoreData is to add a default store to the default stack:
The simplest way to initialize CoreStore is to add a default store to the default stack:
```swift
HardcoreData.defaultStack.addSQLiteStore()
CoreStore.defaultStack.addSQLiteStore()
```
This one-liner does the following:
- Triggers the lazy-initialization of `HardcoreData.defaultStack` with a default `DataStack`
- Triggers the lazy-initialization of `CoreStore.defaultStack` with a default `DataStack`
- Sets up the stack's `NSPersistentStoreCoordinator`, the root saving `NSManagedObjectContext`, and the read-only main `NSManagedObjectContext`
- Adds an automigrating SQLite store in the *"Application Support"* directory with the file name *"[App bundle name].sqlite"*
- Creates and returns the `NSPersistentStore` instance on success, or an `NSError` on failure
@@ -132,10 +132,10 @@ case .Failure(let error): // error is an NSError instance
println("Failed creating an sqlite store with error: \(error.description)"
}
HardcoreData.defaultStack = dataStack // pass the dataStack to HardcoreData for easier access later on
CoreStore.defaultStack = dataStack // pass the dataStack to CoreStore for easier access later on
```
Note that you dont need to do the `HardcoreData.defaultStack = dataStack` line. You can just as well hold a stack like below and call all methods directly from the `DataStack` instance:
Note that you dont need to do the `CoreStore.defaultStack = dataStack` line. You can just as well hold a stack like below and call all methods directly from the `DataStack` instance:
```swift
class MyViewController: UIViewController {
let dataStack = DataStack(modelName: "MyModel")
@@ -149,22 +149,22 @@ class MyViewController: UIViewController {
}
}
```
The difference is when you set the stack as the `HardcoreData.defaultStack`, you can call the stack's methods directly from `HardcoreData` itself:
The difference is when you set the stack as the `CoreStore.defaultStack`, you can call the stack's methods directly from `CoreStore` itself:
```swift
class MyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
HardcoreData.addSQLiteStore()
CoreStore.addSQLiteStore()
}
func methodToBeCalledLaterOn() {
let objects = HardcoreData.fetchAll(From(MyEntity))
let objects = CoreStore.fetchAll(From(MyEntity))
println(objects)
}
}
```
Check out the *HardcoreData.swift* and *DataStack.swift files* if you want to explore the inner workings of the data stack.
Check out the *CoreStore.swift* and *DataStack.swift files* if you want to explore the inner workings of the data stack.