mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-16 05:56:50 +01:00
restructured files, added way to transform section names in ManagedObjectListControllers
This commit is contained in:
@@ -11,51 +11,50 @@
|
||||
2F03A54019C5C6DA005002A5 /* HardcoreDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F03A53F19C5C6DA005002A5 /* HardcoreDataTests.swift */; };
|
||||
2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F03A54C19C5C872005002A5 /* CoreData.framework */; };
|
||||
2F291E2719C6D3CF007AF63F /* HardcoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F291E2619C6D3CF007AF63F /* HardcoreData.swift */; };
|
||||
B503FAE71AFDE20C00F90881 /* NSManagedObject+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B503FAE61AFDE20C00F90881 /* NSManagedObject+Convenience.swift */; };
|
||||
B50DD9DD1ABD34F800D62F2B /* From.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50DD9DC1ABD34F800D62F2B /* From.swift */; };
|
||||
B52B68BA1AAB46AD00CE7F48 /* ManagedObjectController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52B68B91AAB46AD00CE7F48 /* ManagedObjectController.swift */; };
|
||||
B52B68BC1AAB46BD00CE7F48 /* ManagedObjectListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52B68BB1AAB46BD00CE7F48 /* ManagedObjectListController.swift */; };
|
||||
B52B68BE1AAB484C00CE7F48 /* DataStack+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52B68BD1AAB484C00CE7F48 /* DataStack+Observing.swift */; };
|
||||
B52B68C01AAB9DAD00CE7F48 /* ManagedObjectListObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52B68BF1AAB9DAD00CE7F48 /* ManagedObjectListObserver.swift */; };
|
||||
B5398AA21AA8938D00B66388 /* DetachedDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5398AA11AA8938D00B66388 /* DetachedDataTransaction.swift */; };
|
||||
B54A9F071AA7654400AFEC05 /* DataStack+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54A9F061AA7654400AFEC05 /* DataStack+Querying.swift */; };
|
||||
B54D53071AB3538500D55BA8 /* QueryClause.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54D53061AB3538500D55BA8 /* QueryClause.swift */; };
|
||||
B57078B01A50392D007E33F2 /* FetchClause.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57078AF1A50392D007E33F2 /* FetchClause.swift */; };
|
||||
B582DF821A98B0E7003F09C6 /* HardcoreData+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B582DF811A98B0E7003F09C6 /* HardcoreData+Querying.swift */; };
|
||||
B582DF861A98B11B003F09C6 /* HardcoreData+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B582DF851A98B11B003F09C6 /* HardcoreData+Transaction.swift */; };
|
||||
B595CAC41A9A11C1009A397F /* NSManagedObjectContext+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B595CAC31A9A11C1009A397F /* NSManagedObjectContext+Setup.swift */; };
|
||||
B595CAC61A9A1260009A397F /* NSManagedObjectContext+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B595CAC51A9A1260009A397F /* NSManagedObjectContext+Transaction.swift */; };
|
||||
B595CAC81A9A161B009A397F /* WeakObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B595CAC71A9A161B009A397F /* WeakObject.swift */; };
|
||||
B5BC26DD1AF78A8800276889 /* ManagedObjectObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BC26DC1AF78A8800276889 /* ManagedObjectObserver.swift */; };
|
||||
B5BC271D1AFA500400276889 /* HardcoreData+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BC271C1AFA500400276889 /* HardcoreData+Observing.swift */; };
|
||||
B5CFD36E1A0775F000B7885F /* SaveResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5CFD36D1A0775F000B7885F /* SaveResult.swift */; };
|
||||
B5CFF23E19FD1D1C00D6DFC4 /* NSManagedObjectContext+HardcoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5CFF23D19FD1D1C00D6DFC4 /* NSManagedObjectContext+HardcoreData.swift */; };
|
||||
B5CFF24019FD383100D6DFC4 /* BaseDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5CFF23F19FD383100D6DFC4 /* BaseDataTransaction.swift */; };
|
||||
B5D022661A90CD340070CA63 /* DataStack+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D022651A90CD340070CA63 /* DataStack+Transaction.swift */; };
|
||||
B5D10DC01AB42C85004B4EEA /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D10DBF1AB42C85004B4EEA /* GroupBy.swift */; };
|
||||
B5D10DC21AB4590F004B4EEA /* Select.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D10DC11AB4590F004B4EEA /* Select.swift */; };
|
||||
B5D19BFB1AA14063001D1A99 /* AsynchronousDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D19BFA1AA14063001D1A99 /* AsynchronousDataTransaction.swift */; };
|
||||
B5D19BFF1AA14351001D1A99 /* SynchronousDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D19BFE1AA14351001D1A99 /* SynchronousDataTransaction.swift */; };
|
||||
B5D19C011AA15E1F001D1A99 /* HardcoreData+Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D19C001AA15E1F001D1A99 /* HardcoreData+Logging.swift */; };
|
||||
B5D1E22A19FA9E63003B2874 /* PersistentStoreResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22919FA9E63003B2874 /* PersistentStoreResult.swift */; };
|
||||
B5D1E22C19FA9FBC003B2874 /* NSError+HardcoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* NSError+HardcoreData.swift */; };
|
||||
B5D372841A39CD6900F583D9 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B5D372821A39CD6900F583D9 /* Model.xcdatamodeld */; };
|
||||
B5D372861A39CDDB00F583D9 /* TestEntity1.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D372851A39CDDB00F583D9 /* TestEntity1.swift */; };
|
||||
B5D399F119FC818E000E91BB /* DataStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D399F019FC818E000E91BB /* DataStack.swift */; };
|
||||
B5D39A0219FD00C9000E91BB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5D39A0119FD00C9000E91BB /* Foundation.framework */; };
|
||||
B5D39A0419FD00DE000E91BB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5D39A0319FD00DE000E91BB /* UIKit.framework */; };
|
||||
B5D5E0CF1A4D6AAB006468AF /* TestEntity2.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D5E0CE1A4D6AAB006468AF /* TestEntity2.swift */; };
|
||||
B5D8080E1A3471A500A44484 /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5D808021A34715700A44484 /* GCDKit.framework */; };
|
||||
B5D808161A34947300A44484 /* NotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D808151A34947300A44484 /* NotificationObserver.swift */; };
|
||||
B5D8081A1A3495BD00A44484 /* AssociatedObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D808191A3495BD00A44484 /* AssociatedObjects.swift */; };
|
||||
B5E126551A7DCE1400AD8B39 /* Where.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E126541A7DCE1400AD8B39 /* Where.swift */; };
|
||||
B5E126571A7DCE5900AD8B39 /* SortedBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E126561A7DCE5900AD8B39 /* SortedBy.swift */; };
|
||||
B5E209E01A0726460089C9D4 /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E209DF1A0726460089C9D4 /* NSManagedObject+Transaction.swift */; };
|
||||
B5F409E91A8B11CE00A228EA /* HardcoreDataLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F409E81A8B11CE00A228EA /* HardcoreDataLogger.swift */; };
|
||||
B5F409EB1A8B199600A228EA /* DefaultLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F409EA1A8B199600A228EA /* DefaultLogger.swift */; };
|
||||
B5F409ED1A8B200700A228EA /* NSManagedObjectContext+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F409EC1A8B200700A228EA /* NSManagedObjectContext+Querying.swift */; };
|
||||
B5F409EF1A8B243D00A228EA /* BaseDataTransaction+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F409EE1A8B243D00A228EA /* BaseDataTransaction+Querying.swift */; };
|
||||
B5F409F11A8B27A600A228EA /* CustomizeFetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F409F01A8B27A600A228EA /* CustomizeFetch.swift */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
B5E84F0E1AFF847B0064E85B /* CustomizeFetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F001AFF847B0064E85B /* CustomizeFetch.swift */; };
|
||||
B5E84F0F1AFF847B0064E85B /* From.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F011AFF847B0064E85B /* From.swift */; };
|
||||
B5E84F101AFF847B0064E85B /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F021AFF847B0064E85B /* GroupBy.swift */; };
|
||||
B5E84F111AFF847B0064E85B /* Select.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F031AFF847B0064E85B /* Select.swift */; };
|
||||
B5E84F121AFF847B0064E85B /* SortedBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F041AFF847B0064E85B /* SortedBy.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 */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
B5E84F251AFF84860064E85B /* ManagedObjectObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1F1AFF84860064E85B /* ManagedObjectObserver.swift */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
B5E84F381AFF85470064E85B /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */; };
|
||||
B5E84F391AFF85470064E85B /* NSManagedObjectContext+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */; };
|
||||
B5E84F411AFF8CCD0064E85B /* ClauseTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F401AFF8CCD0064E85B /* ClauseTypes.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -91,53 +90,52 @@
|
||||
2F03A53F19C5C6DA005002A5 /* HardcoreDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = HardcoreDataTests.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; };
|
||||
B503FAE61AFDE20C00F90881 /* NSManagedObject+Convenience.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Convenience.swift"; sourceTree = "<group>"; };
|
||||
B50DD9DC1ABD34F800D62F2B /* From.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = From.swift; sourceTree = "<group>"; };
|
||||
B52B68B91AAB46AD00CE7F48 /* ManagedObjectController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectController.swift; sourceTree = "<group>"; };
|
||||
B52B68BB1AAB46BD00CE7F48 /* ManagedObjectListController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectListController.swift; sourceTree = "<group>"; };
|
||||
B52B68BD1AAB484C00CE7F48 /* DataStack+Observing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Observing.swift"; sourceTree = "<group>"; };
|
||||
B52B68BF1AAB9DAD00CE7F48 /* ManagedObjectListObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectListObserver.swift; sourceTree = "<group>"; };
|
||||
B5398AA11AA8938D00B66388 /* DetachedDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetachedDataTransaction.swift; sourceTree = "<group>"; };
|
||||
B54A9F061AA7654400AFEC05 /* DataStack+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Querying.swift"; sourceTree = "<group>"; };
|
||||
B54D53061AB3538500D55BA8 /* QueryClause.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryClause.swift; sourceTree = "<group>"; };
|
||||
B57078AF1A50392D007E33F2 /* FetchClause.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchClause.swift; sourceTree = "<group>"; };
|
||||
B582DF811A98B0E7003F09C6 /* HardcoreData+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Querying.swift"; sourceTree = "<group>"; };
|
||||
B582DF851A98B11B003F09C6 /* HardcoreData+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Transaction.swift"; sourceTree = "<group>"; };
|
||||
B595CAC31A9A11C1009A397F /* NSManagedObjectContext+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Setup.swift"; sourceTree = "<group>"; };
|
||||
B595CAC51A9A1260009A397F /* NSManagedObjectContext+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Transaction.swift"; sourceTree = "<group>"; };
|
||||
B595CAC71A9A161B009A397F /* WeakObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeakObject.swift; sourceTree = "<group>"; };
|
||||
B5BC26DC1AF78A8800276889 /* ManagedObjectObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectObserver.swift; sourceTree = "<group>"; };
|
||||
B5BC271C1AFA500400276889 /* HardcoreData+Observing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Observing.swift"; sourceTree = "<group>"; };
|
||||
B5CFD36D1A0775F000B7885F /* SaveResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SaveResult.swift; sourceTree = "<group>"; };
|
||||
B5CFF23D19FD1D1C00D6DFC4 /* NSManagedObjectContext+HardcoreData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+HardcoreData.swift"; sourceTree = "<group>"; };
|
||||
B5CFF23F19FD383100D6DFC4 /* BaseDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseDataTransaction.swift; sourceTree = "<group>"; };
|
||||
B5D022651A90CD340070CA63 /* DataStack+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Transaction.swift"; sourceTree = "<group>"; };
|
||||
B5D10DBF1AB42C85004B4EEA /* GroupBy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupBy.swift; sourceTree = "<group>"; };
|
||||
B5D10DC11AB4590F004B4EEA /* Select.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Select.swift; sourceTree = "<group>"; };
|
||||
B5D10DC41AB9C747004B4EEA /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
B5D19BFA1AA14063001D1A99 /* AsynchronousDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsynchronousDataTransaction.swift; sourceTree = "<group>"; };
|
||||
B5D19BFE1AA14351001D1A99 /* SynchronousDataTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronousDataTransaction.swift; sourceTree = "<group>"; };
|
||||
B5D19C001AA15E1F001D1A99 /* HardcoreData+Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HardcoreData+Logging.swift"; sourceTree = "<group>"; };
|
||||
B5D1E22919FA9E63003B2874 /* PersistentStoreResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersistentStoreResult.swift; sourceTree = "<group>"; };
|
||||
B5D1E22B19FA9FBC003B2874 /* NSError+HardcoreData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSError+HardcoreData.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>"; };
|
||||
B5D399F019FC818E000E91BB /* DataStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataStack.swift; sourceTree = "<group>"; };
|
||||
B5D39A0119FD00C9000E91BB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
B5D39A0319FD00DE000E91BB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
B5D5E0CE1A4D6AAB006468AF /* TestEntity2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEntity2.swift; sourceTree = "<group>"; };
|
||||
B5D806C51A34715700A44484 /* GCDKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = GCDKit.xcodeproj; sourceTree = "<group>"; };
|
||||
B5D808151A34947300A44484 /* NotificationObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = NotificationObserver.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
|
||||
B5D808191A3495BD00A44484 /* AssociatedObjects.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociatedObjects.swift; sourceTree = "<group>"; };
|
||||
B5E126541A7DCE1400AD8B39 /* Where.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Where.swift; sourceTree = "<group>"; };
|
||||
B5E126561A7DCE5900AD8B39 /* SortedBy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SortedBy.swift; sourceTree = "<group>"; };
|
||||
B5E209DF1A0726460089C9D4 /* NSManagedObject+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Transaction.swift"; sourceTree = "<group>"; };
|
||||
B5F3D98419F3EB8E009690A6 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||
B5F409E81A8B11CE00A228EA /* HardcoreDataLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HardcoreDataLogger.swift; sourceTree = "<group>"; };
|
||||
B5F409EA1A8B199600A228EA /* DefaultLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultLogger.swift; sourceTree = "<group>"; };
|
||||
B5F409EC1A8B200700A228EA /* NSManagedObjectContext+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Querying.swift"; sourceTree = "<group>"; };
|
||||
B5F409EE1A8B243D00A228EA /* BaseDataTransaction+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BaseDataTransaction+Querying.swift"; sourceTree = "<group>"; };
|
||||
B5F409F01A8B27A600A228EA /* CustomizeFetch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomizeFetch.swift; sourceTree = "<group>"; };
|
||||
B5E84ED81AFF82360064E85B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
|
||||
B5E84ED91AFF82360064E85B /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
B5E84F001AFF847B0064E85B /* CustomizeFetch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomizeFetch.swift; sourceTree = "<group>"; };
|
||||
B5E84F011AFF847B0064E85B /* From.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = From.swift; sourceTree = "<group>"; };
|
||||
B5E84F021AFF847B0064E85B /* GroupBy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupBy.swift; sourceTree = "<group>"; };
|
||||
B5E84F031AFF847B0064E85B /* Select.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Select.swift; sourceTree = "<group>"; };
|
||||
B5E84F041AFF847B0064E85B /* SortedBy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SortedBy.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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
B5E84F1F1AFF84860064E85B /* ManagedObjectObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectObserver.swift; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Transaction.swift"; sourceTree = "<group>"; };
|
||||
B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Querying.swift"; sourceTree = "<group>"; };
|
||||
B5E84F401AFF8CCD0064E85B /* ClauseTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClauseTypes.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -188,13 +186,13 @@
|
||||
2F03A53519C5C6DA005002A5 /* HardcoreData.h */,
|
||||
2F291E2619C6D3CF007AF63F /* HardcoreData.swift */,
|
||||
B5D1E22B19FA9FBC003B2874 /* NSError+HardcoreData.swift */,
|
||||
B595CAC01A9A0AC4009A397F /* Setting Up */,
|
||||
B5D022621A90BCC60070CA63 /* Saving and Processing */,
|
||||
B5F409E51A8B11B600A228EA /* Logging */,
|
||||
B5E126531A7DCCE400AD8B39 /* Fetching and Querying */,
|
||||
B52B68B61AAB45FB00CE7F48 /* Observing */,
|
||||
B503FAE31AFDE1E500F90881 /* Convenience Helpers */,
|
||||
B5D808141A34945A00A44484 /* Internal */,
|
||||
B5E84EDA1AFF84500064E85B /* Setting Up */,
|
||||
B5E84EE21AFF84610064E85B /* Logging */,
|
||||
B5E84EE91AFF846E0064E85B /* Saving and Processing */,
|
||||
B5E84EFD1AFF847B0064E85B /* Fetching and Querying */,
|
||||
B5E84F191AFF84860064E85B /* Observing */,
|
||||
B5E84F261AFF84920064E85B /* Convenience Helpers */,
|
||||
B5E84F291AFF849C0064E85B /* Internal */,
|
||||
2F03A53319C5C6DA005002A5 /* Supporting Files */,
|
||||
);
|
||||
path = HardcoreData;
|
||||
@@ -203,9 +201,9 @@
|
||||
2F03A53319C5C6DA005002A5 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5F3D98419F3EB8E009690A6 /* LICENSE */,
|
||||
B5D10DC41AB9C747004B4EEA /* README.md */,
|
||||
2F03A53419C5C6DA005002A5 /* Info.plist */,
|
||||
B5E84ED81AFF82360064E85B /* README.md */,
|
||||
B5E84ED91AFF82360064E85B /* LICENSE */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
@@ -240,99 +238,6 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B503FAE31AFDE1E500F90881 /* Convenience Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B503FAE61AFDE20C00F90881 /* NSManagedObject+Convenience.swift */,
|
||||
);
|
||||
name = "Convenience Helpers";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B52B68B61AAB45FB00CE7F48 /* Observing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B52B68BB1AAB46BD00CE7F48 /* ManagedObjectListController.swift */,
|
||||
B52B68BF1AAB9DAD00CE7F48 /* ManagedObjectListObserver.swift */,
|
||||
B52B68B91AAB46AD00CE7F48 /* ManagedObjectController.swift */,
|
||||
B5BC26DC1AF78A8800276889 /* ManagedObjectObserver.swift */,
|
||||
B52B68BD1AAB484C00CE7F48 /* DataStack+Observing.swift */,
|
||||
B5BC271C1AFA500400276889 /* HardcoreData+Observing.swift */,
|
||||
);
|
||||
name = Observing;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B54A9EFF1AA763D100AFEC05 /* Internal */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5F409EC1A8B200700A228EA /* NSManagedObjectContext+Querying.swift */,
|
||||
);
|
||||
name = Internal;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B54D53041AB350CF00D55BA8 /* Fetching */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B57078AF1A50392D007E33F2 /* FetchClause.swift */,
|
||||
B50DD9DC1ABD34F800D62F2B /* From.swift */,
|
||||
B5E126541A7DCE1400AD8B39 /* Where.swift */,
|
||||
B5E126561A7DCE5900AD8B39 /* SortedBy.swift */,
|
||||
B5F409F01A8B27A600A228EA /* CustomizeFetch.swift */,
|
||||
);
|
||||
name = Fetching;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B54D53051AB350FF00D55BA8 /* Querying */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B54D53061AB3538500D55BA8 /* QueryClause.swift */,
|
||||
B5D10DC11AB4590F004B4EEA /* Select.swift */,
|
||||
B5D10DBF1AB42C85004B4EEA /* GroupBy.swift */,
|
||||
);
|
||||
name = Querying;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B595CAC01A9A0AC4009A397F /* Setting Up */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5D399F019FC818E000E91BB /* DataStack.swift */,
|
||||
B5D1E22919FA9E63003B2874 /* PersistentStoreResult.swift */,
|
||||
B595CAC91A9A1802009A397F /* Internal */,
|
||||
);
|
||||
name = "Setting Up";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B595CAC91A9A1802009A397F /* Internal */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B595CAC31A9A11C1009A397F /* NSManagedObjectContext+Setup.swift */,
|
||||
);
|
||||
name = Internal;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B595CACA1A9A1818009A397F /* Internal */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E209DF1A0726460089C9D4 /* NSManagedObject+Transaction.swift */,
|
||||
B595CAC51A9A1260009A397F /* NSManagedObjectContext+Transaction.swift */,
|
||||
);
|
||||
name = Internal;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5D022621A90BCC60070CA63 /* Saving and Processing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5CFF23F19FD383100D6DFC4 /* BaseDataTransaction.swift */,
|
||||
B5398AA11AA8938D00B66388 /* DetachedDataTransaction.swift */,
|
||||
B5D19BFE1AA14351001D1A99 /* SynchronousDataTransaction.swift */,
|
||||
B5D19BFA1AA14063001D1A99 /* AsynchronousDataTransaction.swift */,
|
||||
B5CFD36D1A0775F000B7885F /* SaveResult.swift */,
|
||||
B582DF851A98B11B003F09C6 /* HardcoreData+Transaction.swift */,
|
||||
B5D022651A90CD340070CA63 /* DataStack+Transaction.swift */,
|
||||
B595CACA1A9A1818009A397F /* Internal */,
|
||||
);
|
||||
name = "Saving and Processing";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5D806BB1A34715700A44484 /* Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -358,38 +263,106 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5D808141A34945A00A44484 /* Internal */ = {
|
||||
B5E84EDA1AFF84500064E85B /* Setting Up */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5D808151A34947300A44484 /* NotificationObserver.swift */,
|
||||
B595CAC71A9A161B009A397F /* WeakObject.swift */,
|
||||
B5D808191A3495BD00A44484 /* AssociatedObjects.swift */,
|
||||
B5CFF23D19FD1D1C00D6DFC4 /* NSManagedObjectContext+HardcoreData.swift */,
|
||||
B5E84EDB1AFF84500064E85B /* DataStack.swift */,
|
||||
B5E84EDE1AFF84500064E85B /* PersistentStoreResult.swift */,
|
||||
);
|
||||
name = Internal;
|
||||
path = "Setting Up";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E126531A7DCCE400AD8B39 /* Fetching and Querying */ = {
|
||||
B5E84EE21AFF84610064E85B /* Logging */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B582DF811A98B0E7003F09C6 /* HardcoreData+Querying.swift */,
|
||||
B54A9F061AA7654400AFEC05 /* DataStack+Querying.swift */,
|
||||
B5F409EE1A8B243D00A228EA /* BaseDataTransaction+Querying.swift */,
|
||||
B54D53041AB350CF00D55BA8 /* Fetching */,
|
||||
B54D53051AB350FF00D55BA8 /* Querying */,
|
||||
B54A9EFF1AA763D100AFEC05 /* Internal */,
|
||||
B5E84EE31AFF84610064E85B /* DefaultLogger.swift */,
|
||||
B5E84EE41AFF84610064E85B /* HardcoreData+Logging.swift */,
|
||||
B5E84EE51AFF84610064E85B /* HardcoreDataLogger.swift */,
|
||||
);
|
||||
name = "Fetching and Querying";
|
||||
path = Logging;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5F409E51A8B11B600A228EA /* Logging */ = {
|
||||
B5E84EE91AFF846E0064E85B /* Saving and Processing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5F409E81A8B11CE00A228EA /* HardcoreDataLogger.swift */,
|
||||
B5F409EA1A8B199600A228EA /* DefaultLogger.swift */,
|
||||
B5D19C001AA15E1F001D1A99 /* HardcoreData+Logging.swift */,
|
||||
B5E84EEA1AFF846E0064E85B /* AsynchronousDataTransaction.swift */,
|
||||
B5E84EEB1AFF846E0064E85B /* BaseDataTransaction.swift */,
|
||||
B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */,
|
||||
B5E84EED1AFF846E0064E85B /* DetachedDataTransaction.swift */,
|
||||
B5E84EEE1AFF846E0064E85B /* HardcoreData+Transaction.swift */,
|
||||
B5E84EF21AFF846E0064E85B /* SaveResult.swift */,
|
||||
B5E84EF31AFF846E0064E85B /* SynchronousDataTransaction.swift */,
|
||||
);
|
||||
name = Logging;
|
||||
path = "Saving and Processing";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E84EFD1AFF847B0064E85B /* Fetching and Querying */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E84EFE1AFF847B0064E85B /* BaseDataTransaction+Querying.swift */,
|
||||
B5E84F061AFF847B0064E85B /* DataStack+Querying.swift */,
|
||||
B5E84F071AFF847B0064E85B /* HardcoreData+Querying.swift */,
|
||||
B5E84F0A1AFF847B0064E85B /* Protocol Clauses */,
|
||||
B5E84EFF1AFF847B0064E85B /* Concrete Clauses */,
|
||||
);
|
||||
path = "Fetching and Querying";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E84EFF1AFF847B0064E85B /* Concrete Clauses */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E84F001AFF847B0064E85B /* CustomizeFetch.swift */,
|
||||
B5E84F011AFF847B0064E85B /* From.swift */,
|
||||
B5E84F021AFF847B0064E85B /* GroupBy.swift */,
|
||||
B5E84F031AFF847B0064E85B /* Select.swift */,
|
||||
B5E84F041AFF847B0064E85B /* SortedBy.swift */,
|
||||
B5E84F051AFF847B0064E85B /* Where.swift */,
|
||||
);
|
||||
path = "Concrete Clauses";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E84F0A1AFF847B0064E85B /* Protocol Clauses */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E84F401AFF8CCD0064E85B /* ClauseTypes.swift */,
|
||||
);
|
||||
path = "Protocol Clauses";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E84F191AFF84860064E85B /* Observing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E84F1A1AFF84860064E85B /* DataStack+Observing.swift */,
|
||||
B5E84F1B1AFF84860064E85B /* HardcoreData+Observing.swift */,
|
||||
B5E84F1C1AFF84860064E85B /* ManagedObjectController.swift */,
|
||||
B5E84F1D1AFF84860064E85B /* ManagedObjectListController.swift */,
|
||||
B5E84F1E1AFF84860064E85B /* ManagedObjectListObserver.swift */,
|
||||
B5E84F1F1AFF84860064E85B /* ManagedObjectObserver.swift */,
|
||||
);
|
||||
path = Observing;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E84F261AFF84920064E85B /* Convenience Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E84F271AFF84920064E85B /* NSManagedObject+Convenience.swift */,
|
||||
);
|
||||
path = "Convenience Helpers";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B5E84F291AFF849C0064E85B /* Internal */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B5E84F2A1AFF849C0064E85B /* AssociatedObjects.swift */,
|
||||
B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */,
|
||||
B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */,
|
||||
B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+HardcoreData.swift */,
|
||||
B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */,
|
||||
B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */,
|
||||
B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */,
|
||||
B5E84F2D1AFF849C0064E85B /* WeakObject.swift */,
|
||||
);
|
||||
path = Internal;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
@@ -523,46 +496,45 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B5CFF24019FD383100D6DFC4 /* BaseDataTransaction.swift in Sources */,
|
||||
B5D19C011AA15E1F001D1A99 /* HardcoreData+Logging.swift in Sources */,
|
||||
B5CFD36E1A0775F000B7885F /* SaveResult.swift in Sources */,
|
||||
B5D022661A90CD340070CA63 /* DataStack+Transaction.swift in Sources */,
|
||||
B582DF861A98B11B003F09C6 /* HardcoreData+Transaction.swift in Sources */,
|
||||
B5E84F221AFF84860064E85B /* ManagedObjectController.swift in Sources */,
|
||||
B5D1E22C19FA9FBC003B2874 /* NSError+HardcoreData.swift in Sources */,
|
||||
B595CAC61A9A1260009A397F /* NSManagedObjectContext+Transaction.swift in Sources */,
|
||||
B50DD9DD1ABD34F800D62F2B /* From.swift in Sources */,
|
||||
B5CFF23E19FD1D1C00D6DFC4 /* NSManagedObjectContext+HardcoreData.swift in Sources */,
|
||||
B54A9F071AA7654400AFEC05 /* DataStack+Querying.swift in Sources */,
|
||||
B5E126571A7DCE5900AD8B39 /* SortedBy.swift in Sources */,
|
||||
B503FAE71AFDE20C00F90881 /* NSManagedObject+Convenience.swift in Sources */,
|
||||
B54D53071AB3538500D55BA8 /* QueryClause.swift in Sources */,
|
||||
B5F409EF1A8B243D00A228EA /* BaseDataTransaction+Querying.swift in Sources */,
|
||||
B5E84F131AFF847B0064E85B /* Where.swift in Sources */,
|
||||
B5E84F141AFF847B0064E85B /* DataStack+Querying.swift in Sources */,
|
||||
B5E84F371AFF85470064E85B /* NSManagedObjectContext+Transaction.swift in Sources */,
|
||||
B5E84F0E1AFF847B0064E85B /* CustomizeFetch.swift in Sources */,
|
||||
B5E84F121AFF847B0064E85B /* SortedBy.swift in Sources */,
|
||||
B5E84F361AFF85470064E85B /* NSManagedObjectContext+Setup.swift in Sources */,
|
||||
B5E84EE71AFF84610064E85B /* HardcoreData+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 */,
|
||||
B5F409E91A8B11CE00A228EA /* HardcoreDataLogger.swift in Sources */,
|
||||
B5D8081A1A3495BD00A44484 /* AssociatedObjects.swift in Sources */,
|
||||
B595CAC41A9A11C1009A397F /* NSManagedObjectContext+Setup.swift in Sources */,
|
||||
B5D19BFF1AA14351001D1A99 /* SynchronousDataTransaction.swift in Sources */,
|
||||
B5BC26DD1AF78A8800276889 /* ManagedObjectObserver.swift in Sources */,
|
||||
B5D10DC21AB4590F004B4EEA /* Select.swift in Sources */,
|
||||
B5E209E01A0726460089C9D4 /* NSManagedObject+Transaction.swift in Sources */,
|
||||
B582DF821A98B0E7003F09C6 /* HardcoreData+Querying.swift in Sources */,
|
||||
B5D19BFB1AA14063001D1A99 /* AsynchronousDataTransaction.swift in Sources */,
|
||||
B5BC271D1AFA500400276889 /* HardcoreData+Observing.swift in Sources */,
|
||||
B595CAC81A9A161B009A397F /* WeakObject.swift in Sources */,
|
||||
B5D1E22A19FA9E63003B2874 /* PersistentStoreResult.swift in Sources */,
|
||||
B5398AA21AA8938D00B66388 /* DetachedDataTransaction.swift in Sources */,
|
||||
B5F409F11A8B27A600A228EA /* CustomizeFetch.swift in Sources */,
|
||||
B5F409EB1A8B199600A228EA /* DefaultLogger.swift in Sources */,
|
||||
B52B68C01AAB9DAD00CE7F48 /* ManagedObjectListObserver.swift in Sources */,
|
||||
B5D399F119FC818E000E91BB /* DataStack.swift in Sources */,
|
||||
B5D808161A34947300A44484 /* NotificationObserver.swift in Sources */,
|
||||
B52B68BE1AAB484C00CE7F48 /* DataStack+Observing.swift in Sources */,
|
||||
B57078B01A50392D007E33F2 /* FetchClause.swift in Sources */,
|
||||
B5F409ED1A8B200700A228EA /* NSManagedObjectContext+Querying.swift in Sources */,
|
||||
B5D10DC01AB42C85004B4EEA /* GroupBy.swift in Sources */,
|
||||
B5E126551A7DCE1400AD8B39 /* Where.swift in Sources */,
|
||||
B52B68BC1AAB46BD00CE7F48 /* ManagedObjectListController.swift in Sources */,
|
||||
B52B68BA1AAB46AD00CE7F48 /* ManagedObjectController.swift in Sources */,
|
||||
B5E84F411AFF8CCD0064E85B /* ClauseTypes.swift in Sources */,
|
||||
B5E84F0D1AFF847B0064E85B /* BaseDataTransaction+Querying.swift in Sources */,
|
||||
B5E84EF61AFF846E0064E85B /* DataStack+Transaction.swift in Sources */,
|
||||
B5E84EDF1AFF84500064E85B /* DataStack.swift in Sources */,
|
||||
B5E84F231AFF84860064E85B /* ManagedObjectListController.swift in Sources */,
|
||||
B5E84EF71AFF846E0064E85B /* DetachedDataTransaction.swift in Sources */,
|
||||
B5E84EF51AFF846E0064E85B /* BaseDataTransaction.swift in Sources */,
|
||||
B5E84EFB1AFF846E0064E85B /* SaveResult.swift in Sources */,
|
||||
B5E84F0F1AFF847B0064E85B /* From.swift in Sources */,
|
||||
B5E84EFC1AFF846E0064E85B /* SynchronousDataTransaction.swift in Sources */,
|
||||
B5E84F281AFF84920064E85B /* NSManagedObject+Convenience.swift in Sources */,
|
||||
B5E84F391AFF85470064E85B /* NSManagedObjectContext+Querying.swift in Sources */,
|
||||
B5E84EE81AFF84610064E85B /* HardcoreDataLogger.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 */,
|
||||
B5E84EE61AFF84610064E85B /* DefaultLogger.swift in Sources */,
|
||||
B5E84EF41AFF846E0064E85B /* AsynchronousDataTransaction.swift in Sources */,
|
||||
B5E84F151AFF847B0064E85B /* HardcoreData+Querying.swift in Sources */,
|
||||
B5E84F241AFF84860064E85B /* ManagedObjectListObserver.swift in Sources */,
|
||||
B5E84F2E1AFF849C0064E85B /* AssociatedObjects.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// FetchClause.swift
|
||||
// HardcoreData
|
||||
//
|
||||
// Copyright (c) 2014 John Rommel Estropia
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
// MARK: - FetchClause
|
||||
|
||||
public protocol FetchClause: QueryClause { }
|
||||
@@ -33,98 +33,98 @@ public extension BaseDataTransaction {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
public func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> T? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchOne(from, queryClauses)
|
||||
return self.context.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> T? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchOne(from, queryClauses)
|
||||
return self.context.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [T]? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchAll(from, queryClauses)
|
||||
return self.context.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [T]? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchAll(from, queryClauses)
|
||||
return self.context.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchCount(from, queryClauses)
|
||||
return self.context.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchCount(from, queryClauses)
|
||||
return self.context.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchObjectID(from, queryClauses)
|
||||
return self.context.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchObjectID(from, queryClauses)
|
||||
return self.context.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchObjectIDs(from, queryClauses)
|
||||
return self.context.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
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.")
|
||||
|
||||
return self.context.fetchObjectIDs(from, queryClauses)
|
||||
return self.context.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
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.")
|
||||
|
||||
return self.context.deleteAll(from, queryClauses)
|
||||
return self.context.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
public func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
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.")
|
||||
|
||||
return self.context.deleteAll(from, queryClauses)
|
||||
return self.context.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: FetchClause...) -> U? {
|
||||
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.")
|
||||
|
||||
return self.context.queryValue(from, selectClause, queryClauses)
|
||||
}
|
||||
|
||||
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [FetchClause]) -> U? {
|
||||
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.")
|
||||
|
||||
@@ -29,7 +29,7 @@ import CoreData
|
||||
|
||||
// MARK: - CustomizeFetch
|
||||
|
||||
public struct CustomizeFetch: FetchClause {
|
||||
public struct CustomizeFetch: FetchClause, QueryClause, DeleteClause {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -39,7 +39,7 @@ public struct CustomizeFetch: FetchClause {
|
||||
}
|
||||
|
||||
|
||||
// MARK: QueryClause
|
||||
// MARK: FetchClause, QueryClause, DeleteClause
|
||||
|
||||
public func applyToFetchRequest(fetchRequest: NSFetchRequest) {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
// MARK: - GroupBy
|
||||
@@ -48,7 +48,7 @@ public enum SortOrder {
|
||||
|
||||
// MARK: - SortedBy
|
||||
|
||||
public struct SortedBy: FetchClause {
|
||||
public struct SortedBy: FetchClause, QueryClause, DeleteClause {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -92,7 +92,7 @@ public struct SortedBy: FetchClause {
|
||||
public let sortDescriptors: [NSSortDescriptor]
|
||||
|
||||
|
||||
// MARK: QueryClause
|
||||
// MARK: FetchClause, QueryClause, DeleteClause
|
||||
|
||||
public func applyToFetchRequest(fetchRequest: NSFetchRequest) {
|
||||
|
||||
@@ -44,7 +44,7 @@ public prefix func !(clause: Where) -> Where {
|
||||
|
||||
// MARK: - Where
|
||||
|
||||
public struct Where: FetchClause {
|
||||
public struct Where: FetchClause, QueryClause, DeleteClause {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -83,7 +83,7 @@ public struct Where: FetchClause {
|
||||
public let predicate: NSPredicate
|
||||
|
||||
|
||||
// MARK: QueryClause
|
||||
// MARK: FetchClause, QueryClause, DeleteClause
|
||||
|
||||
public func applyToFetchRequest(fetchRequest: NSFetchRequest) {
|
||||
|
||||
@@ -34,98 +34,98 @@ public extension DataStack {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
public func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> T? {
|
||||
public func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> T? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchOne(from, queryClauses)
|
||||
return self.mainContext.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> T? {
|
||||
public func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> T? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchOne(from, queryClauses)
|
||||
return self.mainContext.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [T]? {
|
||||
public func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [T]? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchAll(from, queryClauses)
|
||||
return self.mainContext.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [T]? {
|
||||
public func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [T]? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchAll(from, queryClauses)
|
||||
return self.mainContext.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
public func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> Int? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchCount(from, queryClauses)
|
||||
return self.mainContext.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
public func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> Int? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchCount(from, queryClauses)
|
||||
return self.mainContext.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchObjectID(from, queryClauses)
|
||||
return self.mainContext.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
public func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchObjectID(from, queryClauses)
|
||||
return self.mainContext.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchObjectIDs(from, queryClauses)
|
||||
return self.mainContext.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
public func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to fetch from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.fetchObjectIDs(from, queryClauses)
|
||||
return self.mainContext.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
public func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: DeleteClause...) -> Int? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to delete from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.deleteAll(from, queryClauses)
|
||||
return self.mainContext.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
public func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
public func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: [DeleteClause]) -> Int? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to delete from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.deleteAll(from, queryClauses)
|
||||
return self.mainContext.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: FetchClause...) -> U? {
|
||||
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: QueryClause...) -> U? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
return self.mainContext.queryValue(from, selectClause, queryClauses)
|
||||
}
|
||||
|
||||
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [FetchClause]) -> U? {
|
||||
public func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [QueryClause]) -> U? {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to query from a \(typeName(self)) outside the main queue.")
|
||||
|
||||
@@ -31,72 +31,72 @@ public extension HardcoreData {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
public static func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> T? {
|
||||
public static func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> T? {
|
||||
|
||||
return self.defaultStack.fetchOne(from, queryClauses)
|
||||
return self.defaultStack.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> T? {
|
||||
public static func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> T? {
|
||||
|
||||
return self.defaultStack.fetchOne(from, queryClauses)
|
||||
return self.defaultStack.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [T]? {
|
||||
public static func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [T]? {
|
||||
|
||||
return self.defaultStack.fetchAll(from, queryClauses)
|
||||
return self.defaultStack.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [T]? {
|
||||
public static func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [T]? {
|
||||
|
||||
return self.defaultStack.fetchAll(from, queryClauses)
|
||||
return self.defaultStack.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
public static func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> Int? {
|
||||
|
||||
return self.defaultStack.fetchCount(from, queryClauses)
|
||||
return self.defaultStack.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
public static func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> Int? {
|
||||
|
||||
return self.defaultStack.fetchCount(from, queryClauses)
|
||||
return self.defaultStack.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
public static func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
|
||||
return self.defaultStack.fetchObjectID(from, queryClauses)
|
||||
return self.defaultStack.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
public static func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
|
||||
return self.defaultStack.fetchObjectID(from, queryClauses)
|
||||
return self.defaultStack.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
public static func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
|
||||
return self.defaultStack.fetchObjectIDs(from, queryClauses)
|
||||
return self.defaultStack.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
public static func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
|
||||
return self.defaultStack.fetchObjectIDs(from, queryClauses)
|
||||
return self.defaultStack.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
public static func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
public static func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: DeleteClause...) -> Int? {
|
||||
|
||||
return self.defaultStack.deleteAll(from, queryClauses)
|
||||
return self.defaultStack.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
public static func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
public static func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: [DeleteClause]) -> Int? {
|
||||
|
||||
return self.defaultStack.deleteAll(from, queryClauses)
|
||||
return self.defaultStack.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
public static func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: FetchClause...) -> U? {
|
||||
public static func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: QueryClause...) -> U? {
|
||||
|
||||
return self.defaultStack.queryValue(from, selectClause, queryClauses)
|
||||
}
|
||||
|
||||
public static func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [FetchClause]) -> U? {
|
||||
public static func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [QueryClause]) -> U? {
|
||||
|
||||
return self.defaultStack.queryValue(from, selectClause, queryClauses)
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
//
|
||||
// QueryClause.swift
|
||||
// ClauseTypes.swift
|
||||
// HardcoreData
|
||||
//
|
||||
// Copyright (c) 2015 John Rommel Estropia
|
||||
// Copyright (c) 2014 John Rommel Estropia
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -27,9 +27,25 @@ import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
// MARK: - FetchClause
|
||||
|
||||
public protocol FetchClause {
|
||||
|
||||
func applyToFetchRequest(fetchRequest: NSFetchRequest)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - QueryClause
|
||||
|
||||
public protocol QueryClause {
|
||||
|
||||
func applyToFetchRequest(fetchRequest: NSFetchRequest)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - DeleteClause
|
||||
|
||||
public protocol DeleteClause {
|
||||
|
||||
func applyToFetchRequest(fetchRequest: NSFetchRequest)
|
||||
}
|
||||
@@ -33,19 +33,19 @@ internal extension NSManagedObjectContext {
|
||||
|
||||
// MARK: Public
|
||||
|
||||
internal func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> T? {
|
||||
internal func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> T? {
|
||||
|
||||
return self.fetchOne(from, queryClauses)
|
||||
return self.fetchOne(from, fetchClauses)
|
||||
}
|
||||
|
||||
internal func fetchOne<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> T? {
|
||||
internal func fetchOne<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> T? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
fetchRequest.fetchLimit = 1
|
||||
fetchRequest.resultType = .ManagedObjectResultType
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in fetchClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -67,19 +67,19 @@ internal extension NSManagedObjectContext {
|
||||
return fetchResults?.first
|
||||
}
|
||||
|
||||
internal func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [T]? {
|
||||
internal func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [T]? {
|
||||
|
||||
return self.fetchAll(from, queryClauses)
|
||||
return self.fetchAll(from, fetchClauses)
|
||||
}
|
||||
|
||||
internal func fetchAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [T]? {
|
||||
internal func fetchAll<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [T]? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
fetchRequest.fetchLimit = 0
|
||||
fetchRequest.resultType = .ManagedObjectResultType
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in fetchClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -101,17 +101,17 @@ internal extension NSManagedObjectContext {
|
||||
return fetchResults
|
||||
}
|
||||
|
||||
internal func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
internal func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> Int? {
|
||||
|
||||
return self.fetchCount(from, queryClauses)
|
||||
return self.fetchCount(from, fetchClauses)
|
||||
}
|
||||
|
||||
internal func fetchCount<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
internal func fetchCount<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> Int? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in fetchClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -133,19 +133,19 @@ internal extension NSManagedObjectContext {
|
||||
return count
|
||||
}
|
||||
|
||||
internal func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
internal func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> NSManagedObjectID? {
|
||||
|
||||
return self.fetchObjectID(from, queryClauses)
|
||||
return self.fetchObjectID(from, fetchClauses)
|
||||
}
|
||||
|
||||
internal func fetchObjectID<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
internal func fetchObjectID<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
fetchRequest.fetchLimit = 1
|
||||
fetchRequest.resultType = .ManagedObjectIDResultType
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in fetchClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -167,19 +167,19 @@ internal extension NSManagedObjectContext {
|
||||
return fetchResults?.first
|
||||
}
|
||||
|
||||
internal func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
internal func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? {
|
||||
|
||||
return self.fetchObjectIDs(from, queryClauses)
|
||||
return self.fetchObjectIDs(from, fetchClauses)
|
||||
}
|
||||
|
||||
internal func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
internal func fetchObjectIDs<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
fetchRequest.fetchLimit = 0
|
||||
fetchRequest.resultType = .ManagedObjectIDResultType
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in fetchClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -201,12 +201,12 @@ internal extension NSManagedObjectContext {
|
||||
return fetchResults
|
||||
}
|
||||
|
||||
internal func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: FetchClause...) -> Int? {
|
||||
internal func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: DeleteClause...) -> Int? {
|
||||
|
||||
return self.deleteAll(from, queryClauses)
|
||||
return self.deleteAll(from, deleteClauses)
|
||||
}
|
||||
|
||||
internal func deleteAll<T: NSManagedObject>(from: From<T>, _ queryClauses: [FetchClause]) -> Int? {
|
||||
internal func deleteAll<T: NSManagedObject>(from: From<T>, _ deleteClauses: [DeleteClause]) -> Int? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
@@ -214,7 +214,7 @@ internal extension NSManagedObjectContext {
|
||||
fetchRequest.resultType = .ManagedObjectResultType
|
||||
fetchRequest.returnsObjectsAsFaults = true
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in deleteClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -246,12 +246,12 @@ internal extension NSManagedObjectContext {
|
||||
return numberOfDeletedObjects
|
||||
}
|
||||
|
||||
internal func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: FetchClause...) -> U? {
|
||||
internal func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: QueryClause...) -> U? {
|
||||
|
||||
return self.queryValue(from, selectClause, queryClauses)
|
||||
}
|
||||
|
||||
internal func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [FetchClause]) -> U? {
|
||||
internal func queryValue<T: NSManagedObject, U: SelectValueResultType>(from: From<T>, _ selectClause: Select<U>, _ queryClauses: [QueryClause]) -> U? {
|
||||
|
||||
let fetchRequest = NSFetchRequest()
|
||||
fetchRequest.entity = self.entityDescriptionForEntityClass(T)
|
||||
@@ -44,21 +44,37 @@ public extension DataStack {
|
||||
)
|
||||
}
|
||||
|
||||
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ groupBy: GroupBy? = nil, _ queryClauses: FetchClause...) -> ManagedObjectListController<T> {
|
||||
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ fetchClauses: FetchClause...) -> ManagedObjectListController<T> {
|
||||
|
||||
return self.observeObjectList(from, groupBy, queryClauses)
|
||||
return self.observeObjectList(from, fetchClauses)
|
||||
}
|
||||
|
||||
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ groupBy: GroupBy? = nil, _ queryClauses: [FetchClause]) -> ManagedObjectListController<T> {
|
||||
public func observeObjectList<T: NSManagedObject>(from: From<T>, _ fetchClauses: [FetchClause]) -> ManagedObjectListController<T> {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to observe objects from \(typeName(self)) outside the main queue.")
|
||||
|
||||
return ManagedObjectListController(
|
||||
dataStack: self,
|
||||
entity: T.self,
|
||||
sectionNameKeyPath: groupBy?.keyPaths.first,
|
||||
cacheResults: false,
|
||||
queryClauses: queryClauses
|
||||
sectionedBy: nil,
|
||||
fetchClauses: fetchClauses
|
||||
)
|
||||
}
|
||||
|
||||
public func observeSectionedList<T: NSManagedObject>(from: From<T>, _ sectionedBy: SectionedBy, _ fetchClauses: FetchClause...) -> ManagedObjectListController<T> {
|
||||
|
||||
return self.observeSectionedList(from, sectionedBy, fetchClauses)
|
||||
}
|
||||
|
||||
public func observeSectionedList<T: NSManagedObject>(from: From<T>, _ sectionedBy: SectionedBy, _ fetchClauses: [FetchClause]) -> ManagedObjectListController<T> {
|
||||
|
||||
HardcoreData.assert(GCDQueue.Main.isCurrentExecutionContext(), "Attempted to observe objects from \(typeName(self)) outside the main queue.")
|
||||
|
||||
return ManagedObjectListController(
|
||||
dataStack: self,
|
||||
entity: T.self,
|
||||
sectionedBy: sectionedBy,
|
||||
fetchClauses: fetchClauses
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,21 @@ public extension HardcoreData {
|
||||
|
||||
public static func observeObjectList<T: NSManagedObject>(from: From<T>, _ groupBy: GroupBy? = nil, _ queryClauses: FetchClause...) -> ManagedObjectListController<T> {
|
||||
|
||||
return self.defaultStack.observeObjectList(from, groupBy, queryClauses)
|
||||
return self.defaultStack.observeObjectList(from, queryClauses)
|
||||
}
|
||||
|
||||
public static func observeObjectList<T: NSManagedObject>(from: From<T>, _ groupBy: GroupBy? = nil, _ queryClauses: [FetchClause]) -> ManagedObjectListController<T> {
|
||||
|
||||
return self.defaultStack.observeObjectList(from, queryClauses)
|
||||
}
|
||||
|
||||
public static func observeSectionedList<T: NSManagedObject>(from: From<T>, _ sectionedBy: SectionedBy, _ fetchClauses: FetchClause...) -> ManagedObjectListController<T> {
|
||||
|
||||
return self.defaultStack.observeSectionedList(from, sectionedBy, fetchClauses)
|
||||
}
|
||||
|
||||
public static func observeSectionedList<T: NSManagedObject>(from: From<T>, _ sectionedBy: SectionedBy, _ fetchClauses: [FetchClause]) -> ManagedObjectListController<T> {
|
||||
|
||||
return self.defaultStack.observeSectionedList(from, sectionedBy, fetchClauses)
|
||||
}
|
||||
}
|
||||
@@ -28,36 +28,25 @@ import CoreData
|
||||
import GCDKit
|
||||
|
||||
|
||||
private let ManagedObjectListControllerWillChangeListNotification = "ManagedObjectListControllerWillChangeListNotification"
|
||||
private let ManagedObjectListControllerDidChangeListNotification = "ManagedObjectListControllerDidChangeListNotification"
|
||||
// MARK: - SectionedBy
|
||||
|
||||
private let ManagedObjectListControllerDidInsertObjectNotification = "ManagedObjectListControllerDidInsertObjectNotification"
|
||||
private let ManagedObjectListControllerDidDeleteObjectNotification = "ManagedObjectListControllerDidDeleteObjectNotification"
|
||||
private let ManagedObjectListControllerDidUpdateObjectNotification = "ManagedObjectListControllerDidUpdateObjectNotification"
|
||||
private let ManagedObjectListControllerDidMoveObjectNotification = "ManagedObjectListControllerDidMoveObjectNotification"
|
||||
|
||||
private let ManagedObjectListControllerDidInsertSectionNotification = "ManagedObjectListControllerDidInsertSectionNotification"
|
||||
private let ManagedObjectListControllerDidDeleteSectionNotification = "ManagedObjectListControllerDidDeleteSectionNotification"
|
||||
|
||||
private let UserInfoKeyObject = "UserInfoKeyObject"
|
||||
private let UserInfoKeyIndexPath = "UserInfoKeyIndexPath"
|
||||
private let UserInfoKeyNewIndexPath = "UserInfoKeyNewIndexPath"
|
||||
|
||||
private let UserInfoKeySectionInfo = "UserInfoKeySectionInfo"
|
||||
private let UserInfoKeySectionIndex = "UserInfoKeySectionIndex"
|
||||
|
||||
private struct NotificationKey {
|
||||
public struct SectionedBy {
|
||||
|
||||
static var willChangeList: Void?
|
||||
static var didChangeList: Void?
|
||||
// MARK: Public
|
||||
|
||||
static var didInsertObject: Void?
|
||||
static var didDeleteObject: Void?
|
||||
static var didUpdateObject: Void?
|
||||
static var didMoveObject: Void?
|
||||
public init(_ sectionKeyPath: KeyPath) {
|
||||
|
||||
self.init(sectionKeyPath, { $0 })
|
||||
}
|
||||
|
||||
static var didInsertSection: Void?
|
||||
static var didDeleteSection: Void?
|
||||
public init(_ sectionKeyPath: KeyPath, _ sectionNameTransformer: (sectionKeyPath: KeyPath?) -> String?) {
|
||||
|
||||
self.sectionKeyPath = sectionKeyPath
|
||||
self.sectionNameTransformer = sectionNameTransformer
|
||||
}
|
||||
|
||||
internal let sectionKeyPath: KeyPath
|
||||
internal let sectionNameTransformer: (sectionKeyPath: KeyPath?) -> String?
|
||||
}
|
||||
|
||||
|
||||
@@ -456,13 +445,13 @@ public final class ManagedObjectListController<T: NSManagedObject>: FetchedResul
|
||||
|
||||
private func controller(controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String?) -> String? {
|
||||
|
||||
return nil
|
||||
return self.sectionNameTransformer(sectionKeyPath: sectionName)
|
||||
}
|
||||
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
internal init(dataStack: DataStack, entity: T.Type, sectionNameKeyPath: KeyPath?, cacheResults: Bool, queryClauses: [FetchClause]) {
|
||||
internal init(dataStack: DataStack, entity: T.Type, sectionedBy: SectionedBy?, fetchClauses: [FetchClause]) {
|
||||
|
||||
let context = dataStack.mainContext
|
||||
|
||||
@@ -471,7 +460,7 @@ public final class ManagedObjectListController<T: NSManagedObject>: FetchedResul
|
||||
fetchRequest.fetchLimit = 0
|
||||
fetchRequest.resultType = .ManagedObjectResultType
|
||||
|
||||
for clause in queryClauses {
|
||||
for clause in fetchClauses {
|
||||
|
||||
clause.applyToFetchRequest(fetchRequest)
|
||||
}
|
||||
@@ -479,10 +468,8 @@ public final class ManagedObjectListController<T: NSManagedObject>: FetchedResul
|
||||
let fetchedResultsController = NSFetchedResultsController(
|
||||
fetchRequest: fetchRequest,
|
||||
managedObjectContext: context,
|
||||
sectionNameKeyPath: sectionNameKeyPath,
|
||||
cacheName: (cacheResults
|
||||
? "\(self.dynamicType).\(NSUUID())"
|
||||
: nil)
|
||||
sectionNameKeyPath: sectionedBy?.sectionKeyPath,
|
||||
cacheName: nil
|
||||
)
|
||||
|
||||
let fetchedResultsControllerDelegate = FetchedResultsControllerDelegate()
|
||||
@@ -491,6 +478,16 @@ public final class ManagedObjectListController<T: NSManagedObject>: FetchedResul
|
||||
self.fetchedResultsControllerDelegate = fetchedResultsControllerDelegate
|
||||
self.parentStack = dataStack
|
||||
|
||||
if let sectionNameTransformer = sectionedBy?.sectionNameTransformer {
|
||||
|
||||
self.sectionNameTransformer = sectionNameTransformer
|
||||
}
|
||||
else {
|
||||
|
||||
self.sectionNameTransformer = { $0 }
|
||||
}
|
||||
|
||||
|
||||
fetchedResultsControllerDelegate.handler = self
|
||||
fetchedResultsControllerDelegate.fetchedResultsController = fetchedResultsController
|
||||
|
||||
@@ -508,6 +505,7 @@ public final class ManagedObjectListController<T: NSManagedObject>: FetchedResul
|
||||
|
||||
private let fetchedResultsController: NSFetchedResultsController
|
||||
private let fetchedResultsControllerDelegate: FetchedResultsControllerDelegate
|
||||
private let sectionNameTransformer: (sectionKeyPath: KeyPath?) -> String?
|
||||
private weak var parentStack: DataStack?
|
||||
|
||||
private func registerChangeNotification(notificationKey: UnsafePointer<Void>, name: String, toObserver observer: AnyObject, callback: (listController: ManagedObjectListController<T>) -> Void) {
|
||||
@@ -648,3 +646,36 @@ private final class FetchedResultsControllerDelegate: NSFetchedResultsController
|
||||
self.fetchedResultsController?.delegate = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private let ManagedObjectListControllerWillChangeListNotification = "ManagedObjectListControllerWillChangeListNotification"
|
||||
private let ManagedObjectListControllerDidChangeListNotification = "ManagedObjectListControllerDidChangeListNotification"
|
||||
|
||||
private let ManagedObjectListControllerDidInsertObjectNotification = "ManagedObjectListControllerDidInsertObjectNotification"
|
||||
private let ManagedObjectListControllerDidDeleteObjectNotification = "ManagedObjectListControllerDidDeleteObjectNotification"
|
||||
private let ManagedObjectListControllerDidUpdateObjectNotification = "ManagedObjectListControllerDidUpdateObjectNotification"
|
||||
private let ManagedObjectListControllerDidMoveObjectNotification = "ManagedObjectListControllerDidMoveObjectNotification"
|
||||
|
||||
private let ManagedObjectListControllerDidInsertSectionNotification = "ManagedObjectListControllerDidInsertSectionNotification"
|
||||
private let ManagedObjectListControllerDidDeleteSectionNotification = "ManagedObjectListControllerDidDeleteSectionNotification"
|
||||
|
||||
private let UserInfoKeyObject = "UserInfoKeyObject"
|
||||
private let UserInfoKeyIndexPath = "UserInfoKeyIndexPath"
|
||||
private let UserInfoKeyNewIndexPath = "UserInfoKeyNewIndexPath"
|
||||
|
||||
private let UserInfoKeySectionInfo = "UserInfoKeySectionInfo"
|
||||
private let UserInfoKeySectionIndex = "UserInfoKeySectionIndex"
|
||||
|
||||
private struct NotificationKey {
|
||||
|
||||
static var willChangeList: Void?
|
||||
static var didChangeList: Void?
|
||||
|
||||
static var didInsertObject: Void?
|
||||
static var didDeleteObject: Void?
|
||||
static var didUpdateObject: Void?
|
||||
static var didMoveObject: Void?
|
||||
|
||||
static var didInsertSection: Void?
|
||||
static var didDeleteSection: Void?
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
# HardcoreData
|
||||
[](http://cocoadocs.org/docsets/HardcoreData)
|
||||
[](http://cocoadocs.org/docsets/HardcoreData)
|
||||
[](http://cocoadocs.org/docsets/HardcoreData)
|
||||
|
||||
Simple, elegant, and smart Core Data programming with Swift
|
||||
|
||||
## 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. (see "Setting up")
|
||||
- Ability to plug-in your own logging framework (or your favorite 3rd-party logger). (see "Logging and error handling")
|
||||
- Makes it hard to fall into common concurrency mistakes. All Core Data tasks are encapsulated into safer, higher-level abstractions without sacrificing flexibility and customizability. (see "Saving and processing transactions")
|
||||
- Provides convenient API for common use cases. (see "Fetching and querying")
|
||||
- Pleasant API designed around Swift’s code elegance and type safety. (see "TL;DR sample codes")
|
||||
|
||||
#### TL;DR sample codes
|
||||
|
||||
Quick-setup:
|
||||
```swift
|
||||
HardcoreData.defaultStack.addSQLiteStore("MyStore.sqlite")
|
||||
```
|
||||
|
||||
Simple transactions:
|
||||
```swift
|
||||
HardcoreData.beginAsynchronous { (transaction) -> Void in
|
||||
let object = transaction.create(MyEntity)
|
||||
object.entityID = 1
|
||||
object.name = "test entity"
|
||||
|
||||
transaction.commit { (result) -> Void in
|
||||
switch result {
|
||||
case .Success(let hasChanges): println("success!")
|
||||
case .Failure(let error): println(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Easy fetching:
|
||||
```swift
|
||||
let objects = HardcoreData.fetchAll(From(MyEntity))
|
||||
```
|
||||
```swift
|
||||
let objects = HardcoreData.fetchAll(
|
||||
From(MyEntity),
|
||||
Where("entityID", isEqualTo: 1),
|
||||
SortedBy(.Ascending("entityID"), .Descending("name")),
|
||||
CustomizeFetch { (fetchRequest) -> Void in
|
||||
fetchRequest.includesPendingChanges = true
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
Simple queries:
|
||||
```swift
|
||||
let count = HardcoreData.queryValue(
|
||||
From(MyEntity),
|
||||
Select<Int>(.Count("entityID"))
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Architecture
|
||||
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.
|
||||
|
||||
If you are already familiar with the inner workings of CoreData, here is a mapping of `HardcoreData` abstractions:
|
||||
|
||||
| *Core Data* | *HardcoreData* |
|
||||
| --- | --- |
|
||||
| `NSManagedObjectModel` / `NSPersistentStoreCoordinator`<br />(.xcdatamodeld file) | `DataStack` |
|
||||
| `NSPersistentStore`<br />("Configuration"s in the .xcdatamodeld file) | `DataStack` configuration<br />(multiple sqlite / in-memory stores per stack) |
|
||||
| `NSManagedObjectContext` | `BaseDataTransaction` subclasses<br />(`SynchronousDataTransaction`, `AsynchronousDataTransaction`, `DetachedDataTransaction`) |
|
||||
|
||||
RestKit and MagicalRecord set up their `NSManagedObjectContext`s this way:
|
||||
|
||||
<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*:
|
||||
|
||||
<img src="https://cloud.githubusercontent.com/assets/3029684/6734050/4078b642-ce99-11e4-95ea-c0c1d24fbe80.png" alt="nested contexts and merge hybrid" height=212 />
|
||||
|
||||
This allows for a butter-smooth main thread, while still taking advantage of safe nested contexts.
|
||||
|
||||
|
||||
|
||||
## Setting up
|
||||
|
||||
|
||||
## Saving and processing transactions
|
||||
|
||||
|
||||
## Fetching and querying
|
||||
|
||||
|
||||
## Logging and error handling
|
||||
|
||||
|
||||
## Observing changes and notifications (currently in the works)
|
||||
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ import HardcoreData
|
||||
|
||||
struct Shared {
|
||||
|
||||
static let palettes = HardcoreData.observeObjectList(
|
||||
static let palettes = HardcoreData.observeSectionedList(
|
||||
From(Palette),
|
||||
GroupBy("colorName"),
|
||||
SectionedBy("colorName"),
|
||||
SortedBy(.Ascending("hue"))
|
||||
)
|
||||
}
|
||||
|
||||
85
README.md
85
README.md
@@ -37,11 +37,11 @@ HardcoreData.beginAsynchronous { (transaction) -> Void in
|
||||
|
||||
Easy fetching:
|
||||
```swift
|
||||
let objects = HardcoreData.fetchAll(MyEntity)
|
||||
let objects = HardcoreData.fetchAll(From(MyEntity))
|
||||
```
|
||||
```swift
|
||||
let objects = HardcoreData.fetchAll(
|
||||
MyEntity.self,
|
||||
From(MyEntity),
|
||||
Where("entityID", isEqualTo: 1),
|
||||
SortedBy(.Ascending("entityID"), .Descending("name")),
|
||||
CustomizeFetch { (fetchRequest) -> Void in
|
||||
@@ -53,7 +53,7 @@ let objects = HardcoreData.fetchAll(
|
||||
Simple queries:
|
||||
```swift
|
||||
let count = HardcoreData.queryValue(
|
||||
MyEntity.self,
|
||||
From(MyEntity),
|
||||
Select<Int>(.Count("entityID"))
|
||||
)
|
||||
```
|
||||
@@ -72,9 +72,11 @@ If you are already familiar with the inner workings of CoreData, here is a mappi
|
||||
| `NSManagedObjectContext` | `BaseDataTransaction` subclasses<br />(`SynchronousDataTransaction`, `AsynchronousDataTransaction`, `DetachedDataTransaction`) |
|
||||
|
||||
RestKit and MagicalRecord set up their `NSManagedObjectContext`s this way:
|
||||
|
||||
<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*:
|
||||
|
||||
<img src="https://cloud.githubusercontent.com/assets/3029684/6734050/4078b642-ce99-11e4-95ea-c0c1d24fbe80.png" alt="nested contexts and merge hybrid" height=212 />
|
||||
|
||||
This allows for a butter-smooth main thread, while still taking advantage of safe nested contexts.
|
||||
@@ -82,19 +84,92 @@ This allows for a butter-smooth main thread, while still taking advantage of saf
|
||||
|
||||
|
||||
## Setting up
|
||||
The simplest way to initialize HardcoreData is to add a default store to the default stack:
|
||||
```swift
|
||||
HardcoreData.defaultStack.addSQLiteStore()
|
||||
```
|
||||
This one-liner does the following:
|
||||
- Triggers the lazy-initialization of `HardcoreData.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
|
||||
|
||||
For most cases this, confuguration is already appropriate. For more hardcore settings, here is a semi-complete example:
|
||||
```swift
|
||||
let dataStack = DataStack(modelName: "MyModel") // loads from the "MyModel.xcdatamodeld" file
|
||||
|
||||
switch dataStack.addInMemoryStore(configuration: "Config1") { // creates an in-memory store with entities from the "Config1" configuration in the .xcdatamodeld file
|
||||
case .Success(let persistentStore): // persistentStore is an NSPersistentStore instance
|
||||
println("Successfully created an in-memory store: \(persistentStore)"
|
||||
case .Failure(let error): // error is an NSError instance
|
||||
println("Failed creating an in-memory store with error: \(error.description)"
|
||||
}
|
||||
|
||||
switch dataStack.addSQLiteStore(
|
||||
fileURL: sqliteFileURL, // set the target file URL for the sqlite file
|
||||
configuration: "Config2", // use entities from the "Config2" configuration in the .xcdatamodeld file
|
||||
automigrating: true, // automatically run lightweight migrations or entity policy migrations when needed
|
||||
resetStoreOnMigrationFailure: true) { // delete and recreate the sqlite file when migration conflicts occur (useful when debugging)
|
||||
case .Success(let persistentStore): // persistentStore is an NSPersistentStore instance
|
||||
println("Successfully created an sqlite store: \(persistentStore)"
|
||||
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
|
||||
```
|
||||
|
||||
Note that you dont need to do the `HardcoreData.defaultStack = dataStack` line. You can just as well hold a stack like this and call all methods directly from the `DataStack` instance:
|
||||
```swift
|
||||
class MyViewController: UIViewController {
|
||||
let dataStack = DataStack(modelName: "MyModel")
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.dataStack.addSQLiteStore()
|
||||
}
|
||||
func methodToBeCalledLaterOn() {
|
||||
let objects = self.dataStack.fetchAll(From(MyEntity))
|
||||
println(objects)
|
||||
}
|
||||
}
|
||||
```
|
||||
The difference is when you set the stack as the `HardcoreData.defaultStack`, you can call the stack's methods directly from `HardcoreData` itself:
|
||||
```swift
|
||||
|
||||
class MyViewController: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
HardcoreData.dataStack.addSQLiteStore()
|
||||
}
|
||||
func methodToBeCalledLaterOn() {
|
||||
let objects = HardcoreData.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.
|
||||
|
||||
|
||||
|
||||
## Saving and processing transactions
|
||||
(implemented; README pending)
|
||||
|
||||
|
||||
## Fetching and querying
|
||||
(implemented; README pending)
|
||||
|
||||
|
||||
## Logging and error handling
|
||||
(implemented; README pending)
|
||||
|
||||
|
||||
## Observing changes and notifications (currently in the works)
|
||||
|
||||
## Observing changes and notifications
|
||||
(implemented; README pending)
|
||||
|
||||
|
||||
## Importing data
|
||||
(currently implementing)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user