diff --git a/.gitignore b/.gitignore index 63fa643..844eef7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ CoreStore.xcodeproj/xcuserdata CoreStoreDemo/CoreStoreDemo.xcodeproj/xcuserdata Carthage/Build CoreStore.xcworkspace/xcuserdata +.DS_Store diff --git a/.travis.yml b/.travis.yml index 98b4f53..c3e05ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode7.1 +osx_image: xcode7.2 sudo: false git: submodules: false @@ -14,14 +14,15 @@ env: - LC_CTYPE=en_US.UTF-8 - LANG=en_US.UTF-8 matrix: - - DESTINATION="OS=9.1,name=iPhone 6s" SCHEME="CoreStore iOS" SDK=iphonesimulator9.1 RUN_TESTS="YES" POD_LINT="NO" - - DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="CoreStore iOS" SDK=iphonesimulator9.1 RUN_TESTS="YES" POD_LINT="NO" - - DESTINATION="OS=8.4,name=iPhone 6" SCHEME="CoreStore iOS" SDK=iphonesimulator9.1 RUN_TESTS="YES" POD_LINT="NO" - - DESTINATION="OS=8.3,name=iPhone 5S" SCHEME="CoreStore iOS" SDK=iphonesimulator9.1 RUN_TESTS="YES" POD_LINT="NO" - - DESTINATION="OS=8.2,name=iPhone 5" SCHEME="CoreStore iOS" SDK=iphonesimulator9.1 RUN_TESTS="YES" POD_LINT="NO" - - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="CoreStore iOS" SDK=iphonesimulator9.1 RUN_TESTS="YES" POD_LINT="YES" - - DESTINATION="arch=x86_64" SCHEME="CoreStore OSX" SDK=macosx10.11 RUN_TESTS="YES" POD_LINT="NO" - - DESTINATION="OS=2.0,name=Apple Watch - 42mm" SCHEME="CoreStore watchOS" SDK=watchsimulator2.0 RUN_TESTS="NO" POD_LINT="NO" + - DESTINATION="OS=9.2,name=iPhone 6s" SCHEME="CoreStore iOS" SDK=iphonesimulator9.2 RUN_TESTS="YES" POD_LINT="NO" + - DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="CoreStore iOS" SDK=iphonesimulator9.2 RUN_TESTS="YES" POD_LINT="NO" + - DESTINATION="OS=8.4,name=iPhone 6" SCHEME="CoreStore iOS" SDK=iphonesimulator9.2 RUN_TESTS="YES" POD_LINT="NO" + - DESTINATION="OS=8.3,name=iPhone 5S" SCHEME="CoreStore iOS" SDK=iphonesimulator9.2 RUN_TESTS="YES" POD_LINT="NO" + - DESTINATION="OS=8.2,name=iPhone 5" SCHEME="CoreStore iOS" SDK=iphonesimulator9.2 RUN_TESTS="YES" POD_LINT="NO" + - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="CoreStore iOS" SDK=iphonesimulator9.2 RUN_TESTS="YES" POD_LINT="YES" + - DESTINATION="arch=x86_64" SCHEME="CoreStore OSX" SDK=macosx10.11 RUN_TESTS="YES" POD_LINT="NO" + - DESTINATION="OS=2.1,name=Apple Watch - 42mm" SCHEME="CoreStore watchOS" SDK=watchsimulator2.1 RUN_TESTS="NO" POD_LINT="NO" + - DESTINATION="OS=9.1,name=Apple TV 1080p" SCHEME="CoreStore tvOS" SDK=appletvsimulator9.1 RUN_TESTS="YES" POD_LINT="NO" before_install: - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - gem install xcpretty --no-rdoc --no-ri --no-document --quiet @@ -34,11 +35,11 @@ script: - xcodebuild -version - xcodebuild -showsdks - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace CoreStore.xcworkspace -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - xcodebuild -workspace CoreStore.xcworkspace -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO test | xcpretty -c; + xcodebuild -workspace CoreStore.xcworkspace -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean test | xcpretty -c; + xcodebuild -workspace CoreStore.xcworkspace -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO clean test | xcpretty -c; fi - - xcodebuild -workspace "CoreStore.xcworkspace" -scheme "CoreStore iOS" -sdk "iphonesimulator9.1" -destination "OS=9.1,name=iPhone 6s" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - - xcodebuild -workspace "CoreStore.xcworkspace" -scheme "CoreStore iOS" -sdk "iphonesimulator9.1" -destination "OS=9.1,name=iPhone 6s" -configuration Release ONLY_ACTIVE_ARCH=NO test | xcpretty -c; + - xcodebuild -workspace "CoreStore.xcworkspace" -scheme "CoreStore iOS" -sdk "iphonesimulator9.2" -destination "OS=9.2,name=iPhone 6s" -configuration Debug ONLY_ACTIVE_ARCH=NO clean test | xcpretty -c; + - xcodebuild -workspace "CoreStore.xcworkspace" -scheme "CoreStore iOS" -sdk "iphonesimulator9.2" -destination "OS=9.2,name=iPhone 6s" -configuration Release ONLY_ACTIVE_ARCH=NO clean test | xcpretty -c; - if [ $POD_LINT == "YES" ]; then pod lib lint --quick; fi diff --git a/CartFile b/CartFile deleted file mode 100644 index a8ee2b6..0000000 --- a/CartFile +++ /dev/null @@ -1 +0,0 @@ -github "JohnEstropia/GCDKit" == 1.1.5 diff --git a/Cartfile.resolved b/Cartfile.resolved index 568d159..2c136d3 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "JohnEstropia/GCDKit" "1.1.5" +github "JohnEstropia/GCDKit" "1.1.7" diff --git a/Carthage/Checkouts/GCDKit b/Carthage/Checkouts/GCDKit index f0ed149..7f6b560 160000 --- a/Carthage/Checkouts/GCDKit +++ b/Carthage/Checkouts/GCDKit @@ -1 +1 @@ -Subproject commit f0ed14911fccc36a60f10e7dbff1db844f560bd0 +Subproject commit 7f6b560ffd4ba0f7b1c6f1ec7e17d32928a9858b diff --git a/CoreStore.podspec b/CoreStore.podspec index 9246a3c..0174d76 100644 --- a/CoreStore.podspec +++ b/CoreStore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CoreStore" - s.version = "1.4.0" + s.version = "1.4.4" s.license = "MIT" s.summary = "Unleashing the real power of Core Data with the elegance and safety of Swift" s.homepage = "https://github.com/JohnEstropia/CoreStore" @@ -10,6 +10,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.10" s.watchos.deployment_target = "2.0" + s.tvos.deployment_target = "9.0" s.source_files = "CoreStore", "CoreStore/**/*.{swift}" s.osx.exclude_files = "CoreStore/Observing/*.{swift}", "CoreStore/Internal/FetchedResultsControllerDelegate.swift", "CoreStore/Convenience Helpers/NSFetchedResultsController+Convenience.swift" @@ -17,5 +18,5 @@ Pod::Spec.new do |s| s.requires_arc = true s.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-D USE_FRAMEWORKS' } - s.dependency "GCDKit", "1.1.5" + s.dependency "GCDKit", "1.1.7" end \ No newline at end of file diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index 177d259..b01d80b 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -11,7 +11,79 @@ 2F03A54019C5C6DA005002A5 /* CoreStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F03A53F19C5C6DA005002A5 /* CoreStoreTests.swift */; }; 2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F03A54C19C5C872005002A5 /* CoreData.framework */; }; 2F291E2719C6D3CF007AF63F /* CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F291E2619C6D3CF007AF63F /* CoreStore.swift */; }; + 82BA18931C4BBCBA00A0916E /* CoreStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18891C4BBCBA00A0916E /* CoreStore.framework */; }; + 82BA18A01C4BBD1400A0916E /* CoreStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* CoreStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82BA18A11C4BBD1D00A0916E /* CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F291E2619C6D3CF007AF63F /* CoreStore.swift */; }; + 82BA18A21C4BBD1D00A0916E /* NSError+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* NSError+CoreStore.swift */; }; + 82BA18A31C4BBD2200A0916E /* DataStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EDB1AFF84500064E85B /* DataStack.swift */; }; + 82BA18A41C4BBD2200A0916E /* PersistentStoreResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EDE1AFF84500064E85B /* PersistentStoreResult.swift */; }; + 82BA18A51C4BBD2200A0916E /* CoreStore+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B504D0D51B02362500B2BBB1 /* CoreStore+Setup.swift */; }; + 82BA18A61C4BBD2900A0916E /* DefaultLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE31AFF84610064E85B /* DefaultLogger.swift */; }; + 82BA18A71C4BBD2900A0916E /* CoreStore+Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE41AFF84610064E85B /* CoreStore+Logging.swift */; }; + 82BA18A81C4BBD2900A0916E /* CoreStoreLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EE51AFF84610064E85B /* CoreStoreLogger.swift */; }; + 82BA18A91C4BBD3100A0916E /* Into.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56007101B3F6BD500A9A8F9 /* Into.swift */; }; + 82BA18AA1C4BBD3100A0916E /* BaseDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEB1AFF846E0064E85B /* BaseDataTransaction.swift */; }; + 82BA18AB1C4BBD3100A0916E /* AsynchronousDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEA1AFF846E0064E85B /* AsynchronousDataTransaction.swift */; }; + 82BA18AC1C4BBD3100A0916E /* SynchronousDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EF31AFF846E0064E85B /* SynchronousDataTransaction.swift */; }; + 82BA18AD1C4BBD3100A0916E /* UnsafeDataTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EED1AFF846E0064E85B /* UnsafeDataTransaction.swift */; }; + 82BA18AE1C4BBD3100A0916E /* DataStack+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */; }; + 82BA18AF1C4BBD3100A0916E /* CoreStore+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EEE1AFF846E0064E85B /* CoreStore+Transaction.swift */; }; + 82BA18B01C4BBD3100A0916E /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */; }; + 82BA18B11C4BBD3100A0916E /* SaveResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EF21AFF846E0064E85B /* SaveResult.swift */; }; + 82BA18B21C4BBD3900A0916E /* ImportableObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F1DA8C1B9AA97D007C5CBB /* ImportableObject.swift */; }; + 82BA18B31C4BBD3900A0916E /* ImportableUniqueObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F1DA8F1B9AA991007C5CBB /* ImportableUniqueObject.swift */; }; + 82BA18B41C4BBD3900A0916E /* BaseDataTransaction+Importing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E834B81B76311F001D3D50 /* BaseDataTransaction+Importing.swift */; }; + 82BA18B51C4BBD3F00A0916E /* BaseDataTransaction+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84EFE1AFF847B0064E85B /* BaseDataTransaction+Querying.swift */; }; + 82BA18B61C4BBD3F00A0916E /* DataStack+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F061AFF847B0064E85B /* DataStack+Querying.swift */; }; + 82BA18B71C4BBD3F00A0916E /* CoreStore+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F071AFF847B0064E85B /* CoreStore+Querying.swift */; }; + 82BA18B81C4BBD4200A0916E /* ClauseTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F401AFF8CCD0064E85B /* ClauseTypes.swift */; }; + 82BA18B91C4BBD4A00A0916E /* From.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F011AFF847B0064E85B /* From.swift */; }; + 82BA18BA1C4BBD4A00A0916E /* Select.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F031AFF847B0064E85B /* Select.swift */; }; + 82BA18BB1C4BBD4A00A0916E /* Where.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F051AFF847B0064E85B /* Where.swift */; }; + 82BA18BC1C4BBD4A00A0916E /* OrderBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F041AFF847B0064E85B /* OrderBy.swift */; }; + 82BA18BD1C4BBD4A00A0916E /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F021AFF847B0064E85B /* GroupBy.swift */; }; + 82BA18BE1C4BBD4A00A0916E /* Tweak.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F001AFF847B0064E85B /* Tweak.swift */; }; + 82BA18BF1C4BBD5300A0916E /* SectionBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56007131B3F6C2800A9A8F9 /* SectionBy.swift */; }; + 82BA18C01C4BBD5300A0916E /* DataStack+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1A1AFF84860064E85B /* DataStack+Observing.swift */; }; + 82BA18C11C4BBD5300A0916E /* CoreStore+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1B1AFF84860064E85B /* CoreStore+Observing.swift */; }; + 82BA18C21C4BBD5300A0916E /* ObjectMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1C1AFF84860064E85B /* ObjectMonitor.swift */; }; + 82BA18C31C4BBD5300A0916E /* ObjectObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1F1AFF84860064E85B /* ObjectObserver.swift */; }; + 82BA18C41C4BBD5300A0916E /* ListMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1D1AFF84860064E85B /* ListMonitor.swift */; }; + 82BA18C51C4BBD5300A0916E /* ListObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F1E1AFF84860064E85B /* ListObserver.swift */; }; + 82BA18C61C4BBD5900A0916E /* DataStack+Migration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56964D31B22FFAD0075EE4A /* DataStack+Migration.swift */; }; + 82BA18C71C4BBD5900A0916E /* CoreStore+Migration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FAD6AD1B518DCB00714891 /* CoreStore+Migration.swift */; }; + 82BA18C81C4BBD5900A0916E /* MigrationChain.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56007151B4018AB00A9A8F9 /* MigrationChain.swift */; }; + 82BA18C91C4BBD5900A0916E /* MigrationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A261201B64BFDB006EB6D3 /* MigrationType.swift */; }; + 82BA18CA1C4BBD5900A0916E /* MigrationResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56965231B356B820075EE4A /* MigrationResult.swift */; }; + 82BA18CB1C4BBD6400A0916E /* NSManagedObject+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F271AFF84920064E85B /* NSManagedObject+Convenience.swift */; }; + 82BA18CC1C4BBD6400A0916E /* NSProgress+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FAD6A81B50A4B300714891 /* NSProgress+Convenience.swift */; }; + 82BA18CD1C4BBD7100A0916E /* AssociatedObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2A1AFF849C0064E85B /* AssociatedObjects.swift */; }; + 82BA18CE1C4BBD7100A0916E /* FetchedResultsControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54A6A541BA15F2A007870FD /* FetchedResultsControllerDelegate.swift */; }; + 82BA18CF1C4BBD7100A0916E /* Functions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E834BA1B7691F3001D3D50 /* Functions.swift */; }; + 82BA18D01C4BBD7100A0916E /* MigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FAD6AB1B51285300714891 /* MigrationManager.swift */; }; + 82BA18D11C4BBD7100A0916E /* NotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */; }; + 82BA18D21C4BBD7100A0916E /* NSFileManager+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */; }; + 82BA18D31C4BBD7100A0916E /* NSManagedObjectContext+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */; }; + 82BA18D41C4BBD7100A0916E /* NSManagedObjectContext+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */; }; + 82BA18D51C4BBD7100A0916E /* NSManagedObjectContext+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */; }; + 82BA18D61C4BBD7100A0916E /* NSManagedObjectContext+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */; }; + 82BA18D71C4BBD7100A0916E /* NSManagedObjectModel+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51BE0691B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift */; }; + 82BA18D81C4BBD7100A0916E /* WeakObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2D1AFF849C0064E85B /* WeakObject.swift */; }; + 82BA18D91C4BBD9700A0916E /* CoreStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F03A53F19C5C6DA005002A5 /* CoreStoreTests.swift */; }; + 82BA18DA1C4BBD9700A0916E /* TestEntity1.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D372851A39CDDB00F583D9 /* TestEntity1.swift */; }; + 82BA18DB1C4BBD9700A0916E /* TestEntity2.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D5E0CE1A4D6AAB006468AF /* TestEntity2.swift */; }; + 82BA18DC1C4BBD9C00A0916E /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B5D372821A39CD6900F583D9 /* Model.xcdatamodeld */; }; + 82BA18DD1C4BBE1400A0916E /* NSFetchedResultsController+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5202CF91C04688100DED140 /* NSFetchedResultsController+Convenience.swift */; }; + 82BA18DF1C4BBE2600A0916E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18DE1C4BBE2600A0916E /* Foundation.framework */; }; + 82BA18E11C4BBE2C00A0916E /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18E01C4BBE2C00A0916E /* CoreData.framework */; }; + B50392F91C478FF3009900CA /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */; }; + B50392FA1C47963F009900CA /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */; }; + B50392FB1C479640009900CA /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */; }; B504D0D61B02362500B2BBB1 /* CoreStore+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B504D0D51B02362500B2BBB1 /* CoreStore+Setup.swift */; }; + B519E4581C4CD2CA00E7B469 /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B519E4571C4CD2CA00E7B469 /* GCDKit.framework */; }; + B519E4591C4CD2D100E7B469 /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B519E4571C4CD2CA00E7B469 /* GCDKit.framework */; }; + B519E45A1C4CD2DA00E7B469 /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B519E4571C4CD2CA00E7B469 /* GCDKit.framework */; }; + B519E45B1C4CD2ED00E7B469 /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B519E4571C4CD2CA00E7B469 /* GCDKit.framework */; }; B51BE06A1B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51BE0691B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift */; }; B5202CFA1C04688100DED140 /* NSFetchedResultsController+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5202CF91C04688100DED140 /* NSFetchedResultsController+Convenience.swift */; }; B5202CFD1C046E8400DED140 /* NSFetchedResultsController+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5202CF91C04688100DED140 /* NSFetchedResultsController+Convenience.swift */; }; @@ -60,7 +132,6 @@ B52DD1C21BE1F94600949AFE /* MigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FAD6AB1B51285300714891 /* MigrationManager.swift */; }; B52DD1C31BE1F94600949AFE /* NotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */; }; B52DD1C41BE1F94600949AFE /* NSFileManager+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */; }; - B52DD1C51BE1F94600949AFE /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */; }; B52DD1C61BE1F94600949AFE /* NSManagedObjectContext+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */; }; B52DD1C71BE1F94600949AFE /* NSManagedObjectContext+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */; }; B52DD1C81BE1F94600949AFE /* NSManagedObjectContext+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */; }; @@ -130,7 +201,6 @@ B56321AD1BD6521C006C9394 /* MigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FAD6AB1B51285300714891 /* MigrationManager.swift */; }; B56321AE1BD6521C006C9394 /* NotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */; }; B56321AF1BD6521C006C9394 /* NSFileManager+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */; }; - B56321B01BD6521C006C9394 /* NSManagedObject+Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */; }; B56321B11BD6521C006C9394 /* NSManagedObjectContext+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */; }; B56321B21BD6521C006C9394 /* NSManagedObjectContext+Querying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */; }; B56321B31BD6521C006C9394 /* NSManagedObjectContext+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */; }; @@ -143,8 +213,6 @@ B5A261211B64BFDB006EB6D3 /* MigrationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A261201B64BFDB006EB6D3 /* MigrationType.swift */; }; B5A93A111C212CB800E47273 /* CoreSpotlight.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A93A101C212CB800E47273 /* CoreSpotlight.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; B5A93A161C21679A00E47273 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A93A151C21679A00E47273 /* MobileCoreServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - B5BDC91D1C2023CF008147CD /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5BDC91C1C2023CF008147CD /* GCDKit.framework */; }; - B5BDC91E1C2023E8008147CD /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5BDC91C1C2023CF008147CD /* GCDKit.framework */; }; B5D1E22C19FA9FBC003B2874 /* NSError+CoreStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* NSError+CoreStore.swift */; }; B5D372841A39CD6900F583D9 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B5D372821A39CD6900F583D9 /* Model.xcdatamodeld */; }; B5D372861A39CDDB00F583D9 /* TestEntity1.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D372851A39CDDB00F583D9 /* TestEntity1.swift */; }; @@ -186,7 +254,6 @@ 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 */; }; B5F1DA8D1B9AA97D007C5CBB /* ImportableObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F1DA8C1B9AA97D007C5CBB /* ImportableObject.swift */; }; @@ -197,6 +264,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 82BA18941C4BBCBA00A0916E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2F03A52719C5C6DA005002A5 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 82BA18881C4BBCBA00A0916E; + remoteInfo = "CoreStore tvOS"; + }; B52DD17F1BE1F8CD00949AFE /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 2F03A52719C5C6DA005002A5 /* Project object */; @@ -222,7 +296,13 @@ 2F03A53F19C5C6DA005002A5 /* CoreStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CoreStoreTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 2F03A54C19C5C872005002A5 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 2F291E2619C6D3CF007AF63F /* CoreStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CoreStore.swift; sourceTree = ""; }; + 82BA18891C4BBCBA00A0916E /* CoreStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreStoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 82BA18DE1C4BBE2600A0916E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 82BA18E01C4BBE2C00A0916E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.1.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = DEVELOPER_DIR; }; + B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Transaction.swift"; sourceTree = ""; }; B504D0D51B02362500B2BBB1 /* CoreStore+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreStore+Setup.swift"; sourceTree = ""; }; + B519E4571C4CD2CA00E7B469 /* GCDKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GCDKit.framework; path = "../../Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/GCDKit.framework"; sourceTree = ""; }; B51BE0691B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectModel+Setup.swift"; sourceTree = ""; }; B5202CF91C04688100DED140 /* NSFetchedResultsController+Convenience.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFetchedResultsController+Convenience.swift"; sourceTree = ""; }; B52DD1741BE1F8CC00949AFE /* CoreStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -243,8 +323,7 @@ B5A261201B64BFDB006EB6D3 /* MigrationType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationType.swift; sourceTree = ""; }; B5A93A101C212CB800E47273 /* CoreSpotlight.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreSpotlight.framework; path = System/Library/Frameworks/CoreSpotlight.framework; sourceTree = SDKROOT; }; B5A93A151C21679A00E47273 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; - B5BDC91A1C202269008147CD /* CartFile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CartFile; sourceTree = ""; }; - B5BDC91C1C2023CF008147CD /* GCDKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GCDKit.framework; path = "../../../Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/GCDKit.framework"; sourceTree = ""; }; + B5BDC91A1C202269008147CD /* Cartfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; B5BDC9271C2024F2008147CD /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = SOURCE_ROOT; }; B5D1E22B19FA9FBC003B2874 /* NSError+CoreStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSError+CoreStore.swift"; sourceTree = ""; }; B5D372831A39CD6900F583D9 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; @@ -290,7 +369,6 @@ B5E84F2D1AFF849C0064E85B /* WeakObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeakObject.swift; sourceTree = ""; }; B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Setup.swift"; sourceTree = ""; }; B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Transaction.swift"; sourceTree = ""; }; - B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Transaction.swift"; sourceTree = ""; }; B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Querying.swift"; sourceTree = ""; }; B5E84F401AFF8CCD0064E85B /* ClauseTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClauseTypes.swift; sourceTree = ""; }; B5F1DA8C1B9AA97D007C5CBB /* ImportableObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportableObject.swift; sourceTree = ""; }; @@ -305,11 +383,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B519E4581C4CD2CA00E7B469 /* GCDKit.framework in Frameworks */, B5A93A111C212CB800E47273 /* CoreSpotlight.framework in Frameworks */, B5A93A161C21679A00E47273 /* MobileCoreServices.framework in Frameworks */, B5D39A0219FD00C9000E91BB /* Foundation.framework in Frameworks */, 2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */, - B5BDC91D1C2023CF008147CD /* GCDKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -320,11 +398,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82BA18851C4BBCBA00A0916E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B519E4591C4CD2D100E7B469 /* GCDKit.framework in Frameworks */, + 82BA18E11C4BBE2C00A0916E /* CoreData.framework in Frameworks */, + 82BA18DF1C4BBE2600A0916E /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 82BA188F1C4BBCBA00A0916E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 82BA18931C4BBCBA00A0916E /* CoreStore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B52DD1701BE1F8CC00949AFE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B5BDC91E1C2023E8008147CD /* GCDKit.framework in Frameworks */, + B519E45A1C4CD2DA00E7B469 /* GCDKit.framework in Frameworks */, B52DD1921BE1F8F000949AFE /* CoreData.framework in Frameworks */, B52DD1911BE1F8EB00949AFE /* Foundation.framework in Frameworks */, ); @@ -342,6 +438,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B519E45B1C4CD2ED00E7B469 /* GCDKit.framework in Frameworks */, B563217C1BD650E3006C9394 /* Foundation.framework in Frameworks */, B563217A1BD650DE006C9394 /* CoreData.framework in Frameworks */, ); @@ -368,6 +465,8 @@ B563216F1BD65082006C9394 /* CoreStore.framework */, B52DD1741BE1F8CC00949AFE /* CoreStore.framework */, B52DD17D1BE1F8CC00949AFE /* CoreStoreTests.xctest */, + 82BA18891C4BBCBA00A0916E /* CoreStore.framework */, + 82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */, ); name = Products; sourceTree = ""; @@ -400,7 +499,7 @@ B5E84ED81AFF82360064E85B /* README.md */, B5E84ED91AFF82360064E85B /* LICENSE */, B5D9C8F61B160ED200E64F0E /* CoreStore.podspec */, - B5BDC91A1C202269008147CD /* CartFile */, + B5BDC91A1C202269008147CD /* Cartfile */, B5BDC9271C2024F2008147CD /* .travis.yml */, ); name = "Supporting Files"; @@ -429,14 +528,16 @@ 2F291E3119C6D4D3007AF63F /* Frameworks */ = { isa = PBXGroup; children = ( + B519E4571C4CD2CA00E7B469 /* GCDKit.framework */, B5A93A151C21679A00E47273 /* MobileCoreServices.framework */, B5A93A101C212CB800E47273 /* CoreSpotlight.framework */, - B5BDC91C1C2023CF008147CD /* GCDKit.framework */, B5548CD71BD65AE50077652A /* CoreData.framework */, B56321791BD650DE006C9394 /* CoreData.framework */, + 82BA18E01C4BBE2C00A0916E /* CoreData.framework */, 2F03A54C19C5C872005002A5 /* CoreData.framework */, B5548CD51BD65AE00077652A /* Foundation.framework */, B563217B1BD650E3006C9394 /* Foundation.framework */, + 82BA18DE1C4BBE2600A0916E /* Foundation.framework */, B5D39A0119FD00C9000E91BB /* Foundation.framework */, ); name = Frameworks; @@ -502,6 +603,7 @@ B5E84EED1AFF846E0064E85B /* UnsafeDataTransaction.swift */, B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */, B5E84EEE1AFF846E0064E85B /* CoreStore+Transaction.swift */, + B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */, B5E84EF21AFF846E0064E85B /* SaveResult.swift */, ); path = "Saving and Processing"; @@ -573,7 +675,6 @@ B5FAD6AB1B51285300714891 /* MigrationManager.swift */, B5E84F2B1AFF849C0064E85B /* NotificationObserver.swift */, B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */, - B5E84F341AFF85470064E85B /* NSManagedObject+Transaction.swift */, B5E84F2C1AFF849C0064E85B /* NSManagedObjectContext+CoreStore.swift */, B5E84F351AFF85470064E85B /* NSManagedObjectContext+Querying.swift */, B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */, @@ -595,6 +696,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82BA18861C4BBCBA00A0916E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 82BA18A01C4BBD1400A0916E /* CoreStore.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B52DD1711BE1F8CC00949AFE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -650,6 +759,42 @@ productReference = 2F03A53B19C5C6DA005002A5 /* CoreStoreTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 82BA18881C4BBCBA00A0916E /* CoreStore tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 82BA189E1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStore tvOS" */; + buildPhases = ( + 82BA18841C4BBCBA00A0916E /* Sources */, + 82BA18851C4BBCBA00A0916E /* Frameworks */, + 82BA18861C4BBCBA00A0916E /* Headers */, + 82BA18871C4BBCBA00A0916E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CoreStore tvOS"; + productName = "CoreStore tvOS"; + productReference = 82BA18891C4BBCBA00A0916E /* CoreStore.framework */; + productType = "com.apple.product-type.framework"; + }; + 82BA18911C4BBCBA00A0916E /* CoreStoreTests tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 82BA189F1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStoreTests tvOS" */; + buildPhases = ( + 82BA188E1C4BBCBA00A0916E /* Sources */, + 82BA188F1C4BBCBA00A0916E /* Frameworks */, + 82BA18901C4BBCBA00A0916E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 82BA18951C4BBCBA00A0916E /* PBXTargetDependency */, + ); + name = "CoreStoreTests tvOS"; + productName = "CoreStore tvOSTests"; + productReference = 82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; B52DD1731BE1F8CC00949AFE /* CoreStore OSX */ = { isa = PBXNativeTarget; buildConfigurationList = B52DD18C1BE1F8CD00949AFE /* Build configuration list for PBXNativeTarget "CoreStore OSX" */; @@ -710,7 +855,7 @@ 2F03A52719C5C6DA005002A5 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0710; + LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "John Rommel Estropia"; TargetAttributes = { @@ -720,6 +865,12 @@ 2F03A53A19C5C6DA005002A5 = { CreatedOnToolsVersion = 6.0; }; + 82BA18881C4BBCBA00A0916E = { + CreatedOnToolsVersion = 7.2; + }; + 82BA18911C4BBCBA00A0916E = { + CreatedOnToolsVersion = 7.2; + }; B52DD1731BE1F8CC00949AFE = { CreatedOnToolsVersion = 7.1; }; @@ -746,6 +897,8 @@ targets = ( 2F03A52F19C5C6DA005002A5 /* CoreStore iOS */, 2F03A53A19C5C6DA005002A5 /* CoreStoreTests iOS */, + 82BA18881C4BBCBA00A0916E /* CoreStore tvOS */, + 82BA18911C4BBCBA00A0916E /* CoreStoreTests tvOS */, B563216E1BD65082006C9394 /* CoreStore watchOS */, B52DD1731BE1F8CC00949AFE /* CoreStore OSX */, B52DD17C1BE1F8CC00949AFE /* CoreStoreTests OSX */, @@ -768,6 +921,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82BA18871C4BBCBA00A0916E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 82BA18901C4BBCBA00A0916E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; B52DD1721BE1F8CC00949AFE /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -814,12 +981,12 @@ B5E84EE71AFF84610064E85B /* CoreStore+Logging.swift in Sources */, B56007111B3F6BD500A9A8F9 /* Into.swift in Sources */, B5E84F111AFF847B0064E85B /* Select.swift in Sources */, + B50392F91C478FF3009900CA /* NSManagedObject+Transaction.swift in Sources */, B5202CFA1C04688100DED140 /* NSFetchedResultsController+Convenience.swift in Sources */, B5E84EE11AFF84500064E85B /* PersistentStoreResult.swift in Sources */, B5E84F251AFF84860064E85B /* ObjectObserver.swift in Sources */, B5E84F2F1AFF849C0064E85B /* NotificationObserver.swift in Sources */, B5F1DA8D1B9AA97D007C5CBB /* ImportableObject.swift in Sources */, - B5E84F381AFF85470064E85B /* NSManagedObject+Transaction.swift in Sources */, B56965241B356B820075EE4A /* MigrationResult.swift in Sources */, 2F291E2719C6D3CF007AF63F /* CoreStore.swift in Sources */, B5E84F411AFF8CCD0064E85B /* ClauseTypes.swift in Sources */, @@ -868,6 +1035,81 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82BA18841C4BBCBA00A0916E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82BA18B61C4BBD3F00A0916E /* DataStack+Querying.swift in Sources */, + 82BA18A21C4BBD1D00A0916E /* NSError+CoreStore.swift in Sources */, + 82BA18B21C4BBD3900A0916E /* ImportableObject.swift in Sources */, + 82BA18AE1C4BBD3100A0916E /* DataStack+Transaction.swift in Sources */, + 82BA18AB1C4BBD3100A0916E /* AsynchronousDataTransaction.swift in Sources */, + 82BA18CE1C4BBD7100A0916E /* FetchedResultsControllerDelegate.swift in Sources */, + 82BA18C51C4BBD5300A0916E /* ListObserver.swift in Sources */, + 82BA18C21C4BBD5300A0916E /* ObjectMonitor.swift in Sources */, + 82BA18A51C4BBD2200A0916E /* CoreStore+Setup.swift in Sources */, + 82BA18BD1C4BBD4A00A0916E /* GroupBy.swift in Sources */, + 82BA18B31C4BBD3900A0916E /* ImportableUniqueObject.swift in Sources */, + 82BA18A11C4BBD1D00A0916E /* CoreStore.swift in Sources */, + 82BA18CF1C4BBD7100A0916E /* Functions.swift in Sources */, + 82BA18A31C4BBD2200A0916E /* DataStack.swift in Sources */, + 82BA18C81C4BBD5900A0916E /* MigrationChain.swift in Sources */, + 82BA18B11C4BBD3100A0916E /* SaveResult.swift in Sources */, + 82BA18DD1C4BBE1400A0916E /* NSFetchedResultsController+Convenience.swift in Sources */, + 82BA18B41C4BBD3900A0916E /* BaseDataTransaction+Importing.swift in Sources */, + 82BA18CA1C4BBD5900A0916E /* MigrationResult.swift in Sources */, + 82BA18C11C4BBD5300A0916E /* CoreStore+Observing.swift in Sources */, + 82BA18BC1C4BBD4A00A0916E /* OrderBy.swift in Sources */, + 82BA18B01C4BBD3100A0916E /* NSManagedObject+Transaction.swift in Sources */, + 82BA18D41C4BBD7100A0916E /* NSManagedObjectContext+Querying.swift in Sources */, + 82BA18D51C4BBD7100A0916E /* NSManagedObjectContext+Setup.swift in Sources */, + 82BA18C91C4BBD5900A0916E /* MigrationType.swift in Sources */, + 82BA18D01C4BBD7100A0916E /* MigrationManager.swift in Sources */, + 82BA18C61C4BBD5900A0916E /* DataStack+Migration.swift in Sources */, + 82BA18CD1C4BBD7100A0916E /* AssociatedObjects.swift in Sources */, + 82BA18B71C4BBD3F00A0916E /* CoreStore+Querying.swift in Sources */, + 82BA18A41C4BBD2200A0916E /* PersistentStoreResult.swift in Sources */, + 82BA18AA1C4BBD3100A0916E /* BaseDataTransaction.swift in Sources */, + 82BA18A91C4BBD3100A0916E /* Into.swift in Sources */, + 82BA18D11C4BBD7100A0916E /* NotificationObserver.swift in Sources */, + 82BA18BB1C4BBD4A00A0916E /* Where.swift in Sources */, + 82BA18D71C4BBD7100A0916E /* NSManagedObjectModel+Setup.swift in Sources */, + 82BA18C31C4BBD5300A0916E /* ObjectObserver.swift in Sources */, + 82BA18D21C4BBD7100A0916E /* NSFileManager+Setup.swift in Sources */, + 82BA18BF1C4BBD5300A0916E /* SectionBy.swift in Sources */, + 82BA18AC1C4BBD3100A0916E /* SynchronousDataTransaction.swift in Sources */, + 82BA18C71C4BBD5900A0916E /* CoreStore+Migration.swift in Sources */, + 82BA18C41C4BBD5300A0916E /* ListMonitor.swift in Sources */, + 82BA18BA1C4BBD4A00A0916E /* Select.swift in Sources */, + 82BA18A71C4BBD2900A0916E /* CoreStore+Logging.swift in Sources */, + 82BA18D81C4BBD7100A0916E /* WeakObject.swift in Sources */, + 82BA18AF1C4BBD3100A0916E /* CoreStore+Transaction.swift in Sources */, + 82BA18CB1C4BBD6400A0916E /* NSManagedObject+Convenience.swift in Sources */, + 82BA18B51C4BBD3F00A0916E /* BaseDataTransaction+Querying.swift in Sources */, + 82BA18D31C4BBD7100A0916E /* NSManagedObjectContext+CoreStore.swift in Sources */, + 82BA18AD1C4BBD3100A0916E /* UnsafeDataTransaction.swift in Sources */, + 82BA18A81C4BBD2900A0916E /* CoreStoreLogger.swift in Sources */, + 82BA18B81C4BBD4200A0916E /* ClauseTypes.swift in Sources */, + 82BA18D61C4BBD7100A0916E /* NSManagedObjectContext+Transaction.swift in Sources */, + 82BA18B91C4BBD4A00A0916E /* From.swift in Sources */, + 82BA18BE1C4BBD4A00A0916E /* Tweak.swift in Sources */, + 82BA18CC1C4BBD6400A0916E /* NSProgress+Convenience.swift in Sources */, + 82BA18C01C4BBD5300A0916E /* DataStack+Observing.swift in Sources */, + 82BA18A61C4BBD2900A0916E /* DefaultLogger.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 82BA188E1C4BBCBA00A0916E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82BA18DA1C4BBD9700A0916E /* TestEntity1.swift in Sources */, + 82BA18DB1C4BBD9700A0916E /* TestEntity2.swift in Sources */, + 82BA18D91C4BBD9700A0916E /* CoreStoreTests.swift in Sources */, + 82BA18DC1C4BBD9C00A0916E /* Model.xcdatamodeld in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B52DD16F1BE1F8CC00949AFE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -905,7 +1147,7 @@ B52DD1A41BE1F92F00949AFE /* ImportableObject.swift in Sources */, B52DD1AE1BE1F93900949AFE /* OrderBy.swift in Sources */, B52DD1BA1BE1F94000949AFE /* MigrationChain.swift in Sources */, - B52DD1C51BE1F94600949AFE /* NSManagedObject+Transaction.swift in Sources */, + B50392FB1C479640009900CA /* NSManagedObject+Transaction.swift in Sources */, B52DD1A31BE1F92C00949AFE /* SaveResult.swift in Sources */, B52DD19F1BE1F92C00949AFE /* SynchronousDataTransaction.swift in Sources */, B52DD1CB1BE1F94600949AFE /* WeakObject.swift in Sources */, @@ -957,6 +1199,7 @@ B56321981BD65216006C9394 /* Where.swift in Sources */, B5202CFD1C046E8400DED140 /* NSFetchedResultsController+Convenience.swift in Sources */, B56321AF1BD6521C006C9394 /* NSFileManager+Setup.swift in Sources */, + B50392FA1C47963F009900CA /* NSManagedObject+Transaction.swift in Sources */, B56321971BD65216006C9394 /* Select.swift in Sources */, B56321AB1BD6521C006C9394 /* FetchedResultsControllerDelegate.swift in Sources */, B56321821BD65216006C9394 /* PersistentStoreResult.swift in Sources */, @@ -977,7 +1220,6 @@ B563218F1BD65216006C9394 /* ImportableObject.swift in Sources */, B56321991BD65216006C9394 /* OrderBy.swift in Sources */, B56321A51BD65216006C9394 /* MigrationChain.swift in Sources */, - B56321B01BD6521C006C9394 /* NSManagedObject+Transaction.swift in Sources */, B563218E1BD65216006C9394 /* SaveResult.swift in Sources */, B56321A21BD65216006C9394 /* ListObserver.swift in Sources */, B563218A1BD65216006C9394 /* SynchronousDataTransaction.swift in Sources */, @@ -1003,6 +1245,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 82BA18951C4BBCBA00A0916E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 82BA18881C4BBCBA00A0916E /* CoreStore tvOS */; + targetProxy = 82BA18941C4BBCBA00A0916E /* PBXContainerItemProxy */; + }; B52DD1801BE1F8CD00949AFE /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B52DD1731BE1F8CC00949AFE /* CoreStore OSX */; @@ -1060,6 +1307,7 @@ SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -1103,6 +1351,7 @@ SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1123,6 +1372,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CoreStore; + SDKROOT = iphoneos; SKIP_INSTALL = YES; }; name = Debug; @@ -1140,6 +1390,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CoreStore; + SDKROOT = iphoneos; SKIP_INSTALL = YES; }; name = Release; @@ -1148,7 +1399,6 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -1157,6 +1407,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CoreStoreTests; + SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -1165,11 +1416,76 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = CoreStoreTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CoreStoreTests; + SDKROOT = iphoneos; + }; + name = Release; + }; + 82BA189A1C4BBCBA00A0916E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = CoreStore/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CoreStore; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Debug; + }; + 82BA189B1C4BBCBA00A0916E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = CoreStore/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CoreStore; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Release; + }; + 82BA189C1C4BBCBA00A0916E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = CoreStoreTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CoreStoreTests; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Debug; + }; + 82BA189D1C4BBCBA00A0916E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = CoreStoreTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CoreStoreTests; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; }; name = Release; }; @@ -1325,6 +1641,24 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 82BA189E1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStore tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 82BA189A1C4BBCBA00A0916E /* Debug */, + 82BA189B1C4BBCBA00A0916E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 82BA189F1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStoreTests tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 82BA189C1C4BBCBA00A0916E /* Debug */, + 82BA189D1C4BBCBA00A0916E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; B52DD18C1BE1F8CD00949AFE /* Build configuration list for PBXNativeTarget "CoreStore OSX" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme new file mode 100644 index 0000000..6e7165c --- /dev/null +++ b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CoreStore/CartFile b/CoreStore/CartFile deleted file mode 100644 index a8ee2b6..0000000 --- a/CoreStore/CartFile +++ /dev/null @@ -1 +0,0 @@ -github "JohnEstropia/GCDKit" == 1.1.5 diff --git a/CoreStore/Cartfile b/CoreStore/Cartfile new file mode 100644 index 0000000..d8f515a --- /dev/null +++ b/CoreStore/Cartfile @@ -0,0 +1 @@ +github "JohnEstropia/GCDKit" == 1.1.7 diff --git a/CoreStore/Fetching and Querying/BaseDataTransaction+Querying.swift b/CoreStore/Fetching and Querying/BaseDataTransaction+Querying.swift index 44496d9..fd63d9d 100644 --- a/CoreStore/Fetching and Querying/BaseDataTransaction+Querying.swift +++ b/CoreStore/Fetching and Querying/BaseDataTransaction+Querying.swift @@ -106,7 +106,7 @@ public extension BaseDataTransaction { public func fetchOne(from: From, _ fetchClauses: FetchClause...) -> T? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -124,7 +124,7 @@ public extension BaseDataTransaction { public func fetchOne(from: From, _ fetchClauses: [FetchClause]) -> T? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -142,7 +142,7 @@ public extension BaseDataTransaction { public func fetchAll(from: From, _ fetchClauses: FetchClause...) -> [T]? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -160,7 +160,7 @@ public extension BaseDataTransaction { public func fetchAll(from: From, _ fetchClauses: [FetchClause]) -> [T]? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -178,7 +178,7 @@ public extension BaseDataTransaction { public func fetchCount(from: From, _ fetchClauses: FetchClause...) -> Int? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -196,7 +196,7 @@ public extension BaseDataTransaction { public func fetchCount(from: From, _ fetchClauses: [FetchClause]) -> Int? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -214,7 +214,7 @@ public extension BaseDataTransaction { public func fetchObjectID(from: From, _ fetchClauses: FetchClause...) -> NSManagedObjectID? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -232,7 +232,7 @@ public extension BaseDataTransaction { public func fetchObjectID(from: From, _ fetchClauses: [FetchClause]) -> NSManagedObjectID? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -250,7 +250,7 @@ public extension BaseDataTransaction { public func fetchObjectIDs(from: From, _ fetchClauses: FetchClause...) -> [NSManagedObjectID]? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -268,7 +268,7 @@ public extension BaseDataTransaction { public func fetchObjectIDs(from: From, _ fetchClauses: [FetchClause]) -> [NSManagedObjectID]? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to fetch from a \(typeName(self)) outside its designated queue." ) @@ -285,7 +285,7 @@ public extension BaseDataTransaction { public func deleteAll(from: From, _ deleteClauses: DeleteClause...) -> Int? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to delete from a \(typeName(self)) outside its designated queue." ) @@ -302,7 +302,7 @@ public extension BaseDataTransaction { public func deleteAll(from: From, _ deleteClauses: [DeleteClause]) -> Int? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to delete from a \(typeName(self)) outside its designated queue." ) @@ -323,7 +323,7 @@ public extension BaseDataTransaction { public func queryValue(from: From, _ selectClause: Select, _ queryClauses: QueryClause...) -> U? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to query from a \(typeName(self)) outside its designated queue." ) @@ -344,7 +344,7 @@ public extension BaseDataTransaction { public func queryValue(from: From, _ selectClause: Select, _ queryClauses: [QueryClause]) -> U? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to query from a \(typeName(self)) outside its designated queue." ) @@ -365,7 +365,7 @@ public extension BaseDataTransaction { public func queryAttributes(from: From, _ selectClause: Select, _ queryClauses: QueryClause...) -> [[NSString: AnyObject]]? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to query from a \(typeName(self)) outside its designated queue." ) @@ -386,7 +386,7 @@ public extension BaseDataTransaction { public func queryAttributes(from: From, _ selectClause: Select, _ queryClauses: [QueryClause]) -> [[NSString: AnyObject]]? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to query from a \(typeName(self)) outside its designated queue." ) diff --git a/CoreStore/Importing Data/BaseDataTransaction+Importing.swift b/CoreStore/Importing Data/BaseDataTransaction+Importing.swift index 7493d12..3498e80 100644 --- a/CoreStore/Importing Data/BaseDataTransaction+Importing.swift +++ b/CoreStore/Importing Data/BaseDataTransaction+Importing.swift @@ -45,7 +45,7 @@ public extension BaseDataTransaction { source: T.ImportSource) throws -> T? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue." ) @@ -74,7 +74,7 @@ public extension BaseDataTransaction { sourceArray: S) throws -> [T] { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue." ) @@ -109,7 +109,7 @@ public extension BaseDataTransaction { source: T.ImportSource) throws -> T? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue." ) @@ -123,6 +123,11 @@ public extension BaseDataTransaction { if let object = self.fetchOne(From(T), Where(uniqueIDKeyPath, isEqualTo: uniqueIDValue)) { + guard T.shouldUpdateFromImportSource(source, inTransaction: self) else { + + return nil + } + try object.updateFromImportSource(source, inTransaction: self) return object } @@ -155,7 +160,7 @@ public extension BaseDataTransaction { @noescape preProcess: (mapping: [T.UniqueIDType: T.ImportSource]) throws -> [T.UniqueIDType: T.ImportSource] = { $0 }) throws -> [T] { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue." ) diff --git a/CoreStore/Info.plist b/CoreStore/Info.plist index 8bce5c7..e22a0c5 100644 --- a/CoreStore/Info.plist +++ b/CoreStore/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.4.0 + 1.4.4 CFBundleSignature ???? CFBundleVersion diff --git a/CoreStore/Internal/NSManagedObjectContext+Transaction.swift b/CoreStore/Internal/NSManagedObjectContext+Transaction.swift index cd0f03a..d9960cd 100644 --- a/CoreStore/Internal/NSManagedObjectContext+Transaction.swift +++ b/CoreStore/Internal/NSManagedObjectContext+Transaction.swift @@ -55,6 +55,15 @@ internal extension NSManagedObjectContext { } } + internal func isRunningInAllowedQueue() -> Bool { + + guard let parentTransaction = self.parentTransaction else { + + return false + } + return parentTransaction.isRunningInAllowedQueue() + } + internal func temporaryContextInTransactionWithConcurrencyType(concurrencyType: NSManagedObjectContextConcurrencyType) -> NSManagedObjectContext { let context = NSManagedObjectContext(concurrencyType: concurrencyType) diff --git a/CoreStore/Migrating/CoreStore+Migration.swift b/CoreStore/Migrating/CoreStore+Migration.swift index 6f4d0dc..e4a8bf1 100644 --- a/CoreStore/Migrating/CoreStore+Migration.swift +++ b/CoreStore/Migrating/CoreStore+Migration.swift @@ -37,7 +37,7 @@ public extension CoreStore { /** Asynchronously adds to the `defaultStack` an SQLite store from the given SQLite file name. Note that using `addSQLiteStore(...)` instead of `addSQLiteStoreAndWait(...)` implies that the migrations are allowed and expected (thus the asynchronous `completion`.) - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. A new SQLite file will be created if it does not exist. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). A new SQLite file will be created if it does not exist. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.allBundles()`. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to report failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false. @@ -58,7 +58,7 @@ public extension CoreStore { /** Asynchronously adds to the `defaultStack` an SQLite store from the given SQLite file URL. Note that using `addSQLiteStore(...)` instead of `addSQLiteStoreAndWait(...)` implies that the migrations are allowed and expected (thus the asynchronous `completion`.) - - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory. Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. + - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory (or the "Caches" directory on tvOS). Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.allBundles()`. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to report failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false. @@ -79,7 +79,7 @@ public extension CoreStore { /** Using the `defaultStack`, migrates an SQLite store with the specified filename to the `DataStack`'s managed object model version WITHOUT adding the migrated store to the data stack. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil` which indicates the "Default" configuration. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. - parameter sourceBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. @@ -98,7 +98,7 @@ public extension CoreStore { /** Using the `defaultStack`, migrates an SQLite store at the specified file URL and configuration name to the `DataStack`'s managed object model version. This method does NOT add the migrated store to the data stack. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil` which indicates the "Default" configuration. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. - parameter sourceBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. @@ -117,7 +117,7 @@ public extension CoreStore { /** Using the `defaultStack`, checks for the required migrations needed for the store with the specified filename and configuration to be migrated to the `DataStack`'s managed object model version. This method throws an error if the store does not exist, if inspection of the store failed, or no mapping model was found/inferred. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil` which indicates the "Default" configuration. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.allBundles()`. :return: an array of `MigrationType`s indicating the chain of migrations required for the store; or `nil` if either inspection of the store failed, or no mapping model was found/inferred. `MigrationType` acts as a `Bool` and evaluates to `false` if no migration is required, and `true` if either a lightweight or custom migration is needed. diff --git a/CoreStore/Migrating/DataStack+Migration.swift b/CoreStore/Migrating/DataStack+Migration.swift index 8c82604..ea9c3cf 100644 --- a/CoreStore/Migrating/DataStack+Migration.swift +++ b/CoreStore/Migrating/DataStack+Migration.swift @@ -78,7 +78,7 @@ public extension DataStack { /** Asynchronously adds to the stack an SQLite store from the given SQLite file name. Note that using `addSQLiteStore(...)` instead of `addSQLiteStoreAndWait(...)` implies that the migrations are allowed and expected (thus the asynchronous `completion`.) - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. A new SQLite file will be created if it does not exist. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). A new SQLite file will be created if it does not exist. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.allBundles()`. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to report failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false. @@ -88,7 +88,7 @@ public extension DataStack { public func addSQLiteStore(fileName fileName: String, configuration: String? = nil, mappingModelBundles: [NSBundle]? = nil, resetStoreOnModelMismatch: Bool = false, completion: (PersistentStoreResult) -> Void) throws -> NSProgress? { return try self.addSQLiteStore( - fileURL: applicationSupportDirectory.URLByAppendingPathComponent( + fileURL: defaultDirectory.URLByAppendingPathComponent( fileName, isDirectory: false ), @@ -102,7 +102,7 @@ public extension DataStack { /** Asynchronously adds to the stack an SQLite store from the given SQLite file URL. Note that using `addSQLiteStore(...)` instead of `addSQLiteStoreAndWait(...)` implies that the migrations are allowed and expected (thus the asynchronous `completion`.) - - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory. Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. + - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory (or the "Caches" directory on tvOS). Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.allBundles()`. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to report failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false. @@ -233,7 +233,7 @@ public extension DataStack { /** Migrates an SQLite store with the specified filename to the `DataStack`'s managed object model version WITHOUT adding the migrated store to the data stack. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil` which indicates the "Default" configuration. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. - parameter sourceBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. @@ -242,7 +242,7 @@ public extension DataStack { public func upgradeSQLiteStoreIfNeeded(fileName fileName: String, configuration: String? = nil, mappingModelBundles: [NSBundle]? = nil, completion: (MigrationResult) -> Void) throws -> NSProgress? { return try self.upgradeSQLiteStoreIfNeeded( - fileURL: applicationSupportDirectory.URLByAppendingPathComponent( + fileURL: defaultDirectory.URLByAppendingPathComponent( fileName, isDirectory: false ), @@ -255,7 +255,7 @@ public extension DataStack { /** Migrates an SQLite store at the specified file URL and configuration name to the `DataStack`'s managed object model version. This method does NOT add the migrated store to the data stack. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil` which indicates the "Default" configuration. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. - parameter sourceBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.mainBundle()`. @@ -293,7 +293,7 @@ public extension DataStack { /** Checks for the required migrations needed for the store with the specified filename and configuration to be migrated to the `DataStack`'s managed object model version. This method throws an error if the store does not exist, if inspection of the store failed, or no mapping model was found/inferred. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil` which indicates the "Default" configuration. - parameter mappingModelBundles: an optional array of bundles to search mapping model files from. If not set, defaults to the `NSBundle.allBundles()`. :return: an array of `MigrationType`s indicating the chain of migrations required for the store; or `nil` if either inspection of the store failed, or no mapping model was found/inferred. `MigrationType` acts as a `Bool` and evaluates to `false` if no migration is required, and `true` if either a lightweight or custom migration is needed. @@ -302,7 +302,7 @@ public extension DataStack { public func requiredMigrationsForSQLiteStore(fileName fileName: String, configuration: String? = nil, mappingModelBundles: [NSBundle] = NSBundle.allBundles() as [NSBundle]) throws -> [MigrationType] { return try requiredMigrationsForSQLiteStore( - fileURL: applicationSupportDirectory.URLByAppendingPathComponent( + fileURL: defaultDirectory.URLByAppendingPathComponent( fileName, isDirectory: false ), diff --git a/CoreStore/Observing/ListMonitor.swift b/CoreStore/Observing/ListMonitor.swift index d2a6179..0192a18 100644 --- a/CoreStore/Observing/ListMonitor.swift +++ b/CoreStore/Observing/ListMonitor.swift @@ -335,6 +335,56 @@ public final class ListMonitor { return sections[section] } + /** + Returns the `NSFetchedResultsSectionInfo`s for all sections + + - returns: the `NSFetchedResultsSectionInfo`s for all sections + */ + @warn_unused_result + public func sections() -> [NSFetchedResultsSectionInfo] { + + CoreStore.assert( + !self.isPendingRefetch || NSThread.isMainThread(), + "Attempted to access a \(typeName(self)) outside the main thread while a refetch is in progress." + ) + + return self.fetchedResultsController.sections ?? [] + } + + /** + Returns the target section for a specified "Section Index" title and index. + + - parameter title: the title of the Section Index + - parameter index: the index of the Section Index + - returns: the target section for the specified "Section Index" title and index. + */ + @warn_unused_result + public func targetSectionForSectionIndex(title title: String, index: Int) -> Int { + + CoreStore.assert( + !self.isPendingRefetch || NSThread.isMainThread(), + "Attempted to access a \(typeName(self)) outside the main thread while a refetch is in progress." + ) + + return self.fetchedResultsController.sectionForSectionIndexTitle(title, atIndex: index) + } + + /** + Returns the section index titles for all sections + + - returns: the section index titles for all sections + */ + @warn_unused_result + public func sectionIndexTitles() -> [String] { + + CoreStore.assert( + !self.isPendingRefetch || NSThread.isMainThread(), + "Attempted to access a \(typeName(self)) outside the main thread while a refetch is in progress." + ) + + return self.fetchedResultsController.sectionIndexTitles + } + /** Returns the index of the `NSManagedObject` if it exists in the `ListMonitor`'s fetched objects, or `nil` if not found. diff --git a/CoreStore/Saving and Processing/BaseDataTransaction.swift b/CoreStore/Saving and Processing/BaseDataTransaction.swift index df4bcb7..e43c09c 100644 --- a/CoreStore/Saving and Processing/BaseDataTransaction.swift +++ b/CoreStore/Saving and Processing/BaseDataTransaction.swift @@ -56,7 +56,7 @@ public /*abstract*/ class BaseDataTransaction { public func create(into: Into) -> T { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to create an entity of type \(typeName(T)) outside its designated queue." ) @@ -110,7 +110,7 @@ public /*abstract*/ class BaseDataTransaction { public func edit(object: T?) -> T? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to update an entity of type \(typeName(object)) outside its designated queue." ) guard let object = object else { @@ -131,7 +131,7 @@ public /*abstract*/ class BaseDataTransaction { public func edit(into: Into, _ objectID: NSManagedObjectID) -> T? { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to update an entity of type \(typeName(T)) outside its designated queue." ) CoreStore.assert( @@ -150,7 +150,7 @@ public /*abstract*/ class BaseDataTransaction { public func delete(object: NSManagedObject?) { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to delete an entity outside its designated queue." ) guard let object = object else { @@ -180,7 +180,7 @@ public /*abstract*/ class BaseDataTransaction { public func delete(objects: S) { CoreStore.assert( - self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(), + self.isRunningInAllowedQueue(), "Attempted to delete entities outside their designated queue." ) @@ -223,4 +223,9 @@ public /*abstract*/ class BaseDataTransaction { context.undoManager = NSUndoManager() } } + + internal func isRunningInAllowedQueue() -> Bool { + + return self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext() + } } diff --git a/CoreStore/Internal/NSManagedObject+Transaction.swift b/CoreStore/Saving and Processing/NSManagedObject+Transaction.swift similarity index 62% rename from CoreStore/Internal/NSManagedObject+Transaction.swift rename to CoreStore/Saving and Processing/NSManagedObject+Transaction.swift index dcf37a2..d9abd28 100644 --- a/CoreStore/Internal/NSManagedObject+Transaction.swift +++ b/CoreStore/Saving and Processing/NSManagedObject+Transaction.swift @@ -2,7 +2,7 @@ // NSManagedObject+Transaction.swift // CoreStore // -// Copyright (c) 2014 John Rommel Estropia +// Copyright (c) 2016 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 @@ -26,10 +26,24 @@ import Foundation import CoreData - // MARK: - NSManagedObject -internal extension NSManagedObject { +public extension NSManagedObject { + + // MARK: Public + + /** + Returns this object's parent `UnsafeDataTransaction` instance if it was created from one. Returns `nil` if the parent transaction is either an `AsynchronousDataTransaction` or a `SynchronousDataTransaction`, or if the object is not managed by CoreStore. + + When using an `UnsafeDataTransaction` and passing around a temporary object, you can use this property to execute fetches and updates to the transaction without having to pass around both the object and the transaction instances. + + Note that the internal reference to the transaction is `weak`, and it is still the developer's responsibility to retain a strong reference to the `UnsafeDataTransaction`. + */ + public var unsafeDataTransaction: UnsafeDataTransaction? { + + return self.managedObjectContext?.parentTransaction as? UnsafeDataTransaction + } + // MARK: Internal diff --git a/CoreStore/Setting Up/CoreStore+Setup.swift b/CoreStore/Setting Up/CoreStore+Setup.swift index bd8364c..de8af13 100644 --- a/CoreStore/Setting Up/CoreStore+Setup.swift +++ b/CoreStore/Setting Up/CoreStore+Setup.swift @@ -72,7 +72,7 @@ public extension CoreStore { /** Adds to the `defaultStack` an SQLite store from the given SQLite file name. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. A new SQLite file will be created if it does not exist. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). A new SQLite file will be created if it does not exist. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to nil. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to throw exceptions on failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false - returns: the `NSPersistentStore` added to the stack. @@ -89,7 +89,7 @@ public extension CoreStore { /** Adds to the `defaultStack` an SQLite store from the given SQLite file URL. - - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory. + - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory (or the "Caches" directory on tvOS). - parameter configuration: an optional configuration name from the model file. If not specified, defaults to nil. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to throw exceptions on failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false. - returns: the `NSPersistentStore` added to the stack. diff --git a/CoreStore/Setting Up/DataStack.swift b/CoreStore/Setting Up/DataStack.swift index a65c5e2..9756b3c 100644 --- a/CoreStore/Setting Up/DataStack.swift +++ b/CoreStore/Setting Up/DataStack.swift @@ -30,11 +30,17 @@ import CoreData #endif -internal let applicationSupportDirectory = NSFileManager.defaultManager().URLsForDirectory(.ApplicationSupportDirectory, inDomains: .UserDomainMask).first! +#if os(tvOS) + internal let deviceDirectorySearchPath = NSSearchPathDirectory.CachesDirectory +#else + internal let deviceDirectorySearchPath = NSSearchPathDirectory.ApplicationSupportDirectory +#endif + +internal let defaultDirectory = NSFileManager.defaultManager().URLsForDirectory(deviceDirectorySearchPath, inDomains: .UserDomainMask).first! internal let applicationName = (NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleName") as? String) ?? "CoreData" -internal let defaultSQLiteStoreURL = applicationSupportDirectory.URLByAppendingPathComponent(applicationName, isDirectory: false).URLByAppendingPathExtension("sqlite") +internal let defaultSQLiteStoreURL = defaultDirectory.URLByAppendingPathComponent(applicationName, isDirectory: false).URLByAppendingPathExtension("sqlite") // MARK: - DataStack @@ -156,7 +162,7 @@ public final class DataStack { /** Adds to the stack an SQLite store from the given SQLite file name. - - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory. A new SQLite file will be created if it does not exist. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. + - parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). A new SQLite file will be created if it does not exist. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to throw exceptions on failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false - returns: the `NSPersistentStore` added to the stack. @@ -164,7 +170,7 @@ public final class DataStack { public func addSQLiteStoreAndWait(fileName fileName: String, configuration: String? = nil, resetStoreOnModelMismatch: Bool = false) throws -> NSPersistentStore { return try self.addSQLiteStoreAndWait( - fileURL: applicationSupportDirectory.URLByAppendingPathComponent( + fileURL: defaultDirectory.URLByAppendingPathComponent( fileName, isDirectory: false ), @@ -176,7 +182,7 @@ public final class DataStack { /** Adds to the stack an SQLite store from the given SQLite file URL. - - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory. Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. + - parameter fileURL: the local file URL for the SQLite persistent store. A new SQLite file will be created if it does not exist. If not specified, defaults to a file URL pointing to a ".sqlite" file in the "Application Support" directory (or the "Caches" directory on tvOS). Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. - parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileURL` explicitly for each of them. - parameter resetStoreOnModelMismatch: Set to true to delete the store on model mismatch; or set to false to throw exceptions on failure instead. Typically should only be set to true when debugging, or if the persistent store can be recreated easily. If not specified, defaults to false. - returns: the `NSPersistentStore` added to the stack. diff --git a/CoreStoreTests/CoreStoreTests.swift b/CoreStoreTests/CoreStoreTests.swift index 72be724..33a58b0 100644 --- a/CoreStoreTests/CoreStoreTests.swift +++ b/CoreStoreTests/CoreStoreTests.swift @@ -295,6 +295,7 @@ class CoreStoreTests: XCTestCase { obj5.testString = "hihihi" obj5.testNumber = 70 obj5.testDate = NSDate() + XCTAssert(unsafeTransaction === obj5.unsafeDataTransaction, "unsafeTransaction === obj5.unsafeDataTransaction") unsafeTransaction.commit { (result) -> Void in @@ -309,6 +310,7 @@ class CoreStoreTests: XCTestCase { let obj5Copy1 = transaction.edit(obj5) XCTAssertTrue(obj5.objectID == obj5Copy1?.objectID, "obj5.objectID == obj5Copy1?.objectID") XCTAssertFalse(obj5 == obj5Copy1, "obj5 == obj5Copy1") + XCTAssertNil(obj5Copy1?.unsafeDataTransaction) let obj5Copy2 = transaction.edit(Into(TestEntity1), obj5.objectID) XCTAssertTrue(obj5.objectID == obj5Copy2?.objectID, "obj5.objectID == obj5Copy2?.objectID") @@ -326,6 +328,7 @@ class CoreStoreTests: XCTestCase { obj6.testString = "huehuehue" obj6.testNumber = 130 obj6.testDate = NSDate() + XCTAssert(unsafeTransaction === obj6.unsafeDataTransaction, "unsafeTransaction === obj6.unsafeDataTransaction") unsafeTransaction.commit { (result) -> Void in @@ -378,7 +381,7 @@ class CoreStoreTests: XCTestCase { let fileManager = NSFileManager.defaultManager() try fileManager.removeItemAtURL( - fileManager.URLsForDirectory(.ApplicationSupportDirectory, inDomains: .UserDomainMask).first! + fileManager.URLsForDirectory(deviceDirectorySearchPath, inDomains: .UserDomainMask).first! ) } catch _ { } diff --git a/README.md b/README.md index 91f991a..29a0581 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # CoreStore -[![Build Status](https://travis-ci.org/JohnEstropia/CoreStore.svg)](https://travis-ci.org/JohnEstropia/CoreStore) +[![Build Status](https://img.shields.io/travis/JohnEstropia/CoreStore/develop.svg)](https://travis-ci.org/JohnEstropia/CoreStore) [![Version](https://img.shields.io/cocoapods/v/CoreStore.svg?style=flat)](http://cocoadocs.org/docsets/CoreStore) [![Platform](https://img.shields.io/cocoapods/p/CoreStore.svg?style=flat)](http://cocoadocs.org/docsets/CoreStore) [![License](https://img.shields.io/cocoapods/l/CoreStore.svg?style=flat)](https://raw.githubusercontent.com/JohnEstropia/CoreStore/master/LICENSE) @@ -174,7 +174,7 @@ catch { This one-liner does the following: - Triggers the lazy-initialization of `CoreStore.defaultStack` with a default `DataStack` - Sets up the stack's `NSPersistentStoreCoordinator`, the root saving `NSManagedObjectContext`, and the read-only main `NSManagedObjectContext` -- Adds an SQLite store in the *"Application Support"* directory with the file name *"[App bundle name].sqlite"* +- Adds an SQLite store in the *"Application Support"* directory (or the *"Caches"* directory on tvOS) 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 configuration is usable as it is. But for more hardcore settings, refer to this extensive example: @@ -1182,6 +1182,7 @@ This installs CoreStore as a framework. Declare `import CoreStore` in your swift ### Install with Carthage ``` github "JohnEstropia/CoreStore" >= 1.3.0 +github "JohnEstropia/GCDKit" >= 1.1.5 ``` ### Install as Git Submodule