From c229af19a2d8ff64a5fdc0a5db06c49eec011465 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Fri, 18 Dec 2015 19:28:02 +0900 Subject: [PATCH 01/17] added GCDKit to Carthage installation guide --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 91f991a..11facd1 100644 --- a/README.md +++ b/README.md @@ -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 From 6c28594e4136fd75ff22563aa5f004bdf1fbc54d Mon Sep 17 00:00:00 2001 From: John Rommel Estropia Date: Tue, 29 Dec 2015 08:25:06 +0800 Subject: [PATCH 02/17] fixed shouldUpdateFromImportSource() not called from importUniqueObject() (fixes #31) --- CoreStore.podspec | 2 +- CoreStore/Importing Data/BaseDataTransaction+Importing.swift | 5 +++++ CoreStore/Info.plist | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CoreStore.podspec b/CoreStore.podspec index 9246a3c..e211754 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.1" 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" diff --git a/CoreStore/Importing Data/BaseDataTransaction+Importing.swift b/CoreStore/Importing Data/BaseDataTransaction+Importing.swift index 7493d12..816eabb 100644 --- a/CoreStore/Importing Data/BaseDataTransaction+Importing.swift +++ b/CoreStore/Importing Data/BaseDataTransaction+Importing.swift @@ -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 } diff --git a/CoreStore/Info.plist b/CoreStore/Info.plist index 8bce5c7..07b3f7e 100644 --- a/CoreStore/Info.plist +++ b/CoreStore/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.4.0 + 1.4.1 CFBundleSignature ???? CFBundleVersion From 761d349b9751f271f75d4ac94a5ef6ada1ba877f Mon Sep 17 00:00:00 2001 From: John Estropia Date: Mon, 4 Jan 2016 12:38:05 +0900 Subject: [PATCH 03/17] Rename CartFile to Cartfile. Sorry about that --- CartFile => Cartfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CartFile => Cartfile (100%) diff --git a/CartFile b/Cartfile similarity index 100% rename from CartFile rename to Cartfile From c2bbd537cfae721b5d7c0c9f8e3caa671199e023 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Mon, 4 Jan 2016 19:38:11 +0900 Subject: [PATCH 04/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11facd1..fa6f010 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/master.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) From 06d177e8bdfad41b206f3a7841fc11d5559756ab Mon Sep 17 00:00:00 2001 From: John Estropia Date: Mon, 4 Jan 2016 19:38:42 +0900 Subject: [PATCH 05/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11facd1..b7f579e 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) From 71c3abc4f31241e9ab95b639071cfeaacb253489 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Wed, 6 Jan 2016 19:16:46 +0900 Subject: [PATCH 06/17] Let ListMonitor expose methods for Section Indexes (fixes #32) --- CoreStore.podspec | 2 +- CoreStore/Info.plist | 2 +- CoreStore/Observing/ListMonitor.swift | 50 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/CoreStore.podspec b/CoreStore.podspec index e211754..bd6c0ca 100644 --- a/CoreStore.podspec +++ b/CoreStore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CoreStore" - s.version = "1.4.1" + s.version = "1.4.2" 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" diff --git a/CoreStore/Info.plist b/CoreStore/Info.plist index 07b3f7e..222de54 100644 --- a/CoreStore/Info.plist +++ b/CoreStore/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.4.1 + 1.4.2 CFBundleSignature ???? CFBundleVersion 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. From c63bc389b2f8d9139c25dbca3b0cb9feb0fbc6cd Mon Sep 17 00:00:00 2001 From: John Estropia Date: Wed, 6 Jan 2016 19:29:58 +0900 Subject: [PATCH 07/17] updated travis.yml --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad1dbef..a7b0ea9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,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.1" -destination "OS=9.1,name=iPhone 6s" -configuration Debug ONLY_ACTIVE_ARCH=NO clean 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 clean test | xcpretty -c; - if [ $POD_LINT == "YES" ]; then pod lib lint --quick; fi From 084bdc431f8ed56884359c2c96b2861dee0ec178 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Fri, 8 Jan 2016 18:40:16 +0900 Subject: [PATCH 08/17] Update .gitignore: Add .DS_Store --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From 3e601c1328fcc6506d1c768bf70514710d158f6f Mon Sep 17 00:00:00 2001 From: John Estropia Date: Fri, 8 Jan 2016 20:44:42 +0900 Subject: [PATCH 09/17] tidy up (WIP: queue check for NSManagedObjectContext property updates) --- .../BaseDataTransaction+Querying.swift | 32 +++++++++---------- .../BaseDataTransaction+Importing.swift | 8 ++--- .../NSManagedObjectContext+Transaction.swift | 9 ++++++ .../BaseDataTransaction.swift | 15 ++++++--- 4 files changed, 39 insertions(+), 25 deletions(-) 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 816eabb..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." ) @@ -160,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/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/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() + } } From 26ab6aacd7abf4cc30ca168f77d99bc28f999a9c Mon Sep 17 00:00:00 2001 From: John Estropia Date: Thu, 14 Jan 2016 17:54:58 +0900 Subject: [PATCH 10/17] exposed utility for extracting the parent transaction for objects created from UnsafeDataTransactions --- CoreStore.podspec | 2 +- CoreStore.xcodeproj/project.pbxproj | 16 +++++++-------- CoreStore/Info.plist | 2 +- .../NSManagedObject+Transaction.swift | 20 ++++++++++++++++--- CoreStoreTests/CoreStoreTests.swift | 3 +++ 5 files changed, 30 insertions(+), 13 deletions(-) rename CoreStore/{Internal => Saving and Processing}/NSManagedObject+Transaction.swift (62%) diff --git a/CoreStore.podspec b/CoreStore.podspec index bd6c0ca..5898145 100644 --- a/CoreStore.podspec +++ b/CoreStore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CoreStore" - s.version = "1.4.2" + s.version = "1.4.3" 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" diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index b424712..72d80f3 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -11,6 +11,9 @@ 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 */; }; + 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 */; }; 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 */; }; @@ -60,7 +63,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 */; }; @@ -127,7 +129,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 */; }; @@ -181,7 +182,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 */; }; @@ -217,6 +217,7 @@ 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 = ""; }; + 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 = ""; }; 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 = ""; }; @@ -282,7 +283,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 = ""; }; @@ -481,6 +481,7 @@ B5E84EED1AFF846E0064E85B /* UnsafeDataTransaction.swift */, B5E84EEC1AFF846E0064E85B /* DataStack+Transaction.swift */, B5E84EEE1AFF846E0064E85B /* CoreStore+Transaction.swift */, + B50392F81C478FF3009900CA /* NSManagedObject+Transaction.swift */, B5E84EF21AFF846E0064E85B /* SaveResult.swift */, ); path = "Saving and Processing"; @@ -552,7 +553,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 */, @@ -793,12 +793,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 */, @@ -882,7 +882,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 */, @@ -934,6 +934,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 */, @@ -954,7 +955,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 */, diff --git a/CoreStore/Info.plist b/CoreStore/Info.plist index 222de54..f517fce 100644 --- a/CoreStore/Info.plist +++ b/CoreStore/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.4.2 + 1.4.3 CFBundleSignature ???? CFBundleVersion 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/CoreStoreTests/CoreStoreTests.swift b/CoreStoreTests/CoreStoreTests.swift index 72be724..8145313 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 From 9322371224a37514bfdb33df4054795443560901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 17 Jan 2016 13:11:58 +0100 Subject: [PATCH 11/17] Use tvOS_support feature branch of GCDKit (Carthage + git submodules) --- .gitmodules | 2 +- Cartfile | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/GCDKit | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5fec53f..5b4a734 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Carthage/Checkouts/GCDKit"] path = Carthage/Checkouts/GCDKit - url = https://github.com/JohnEstropia/GCDKit.git + url = https://github.com/Dschee/GCDKit.git diff --git a/Cartfile b/Cartfile index a8ee2b6..9de2bb1 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "JohnEstropia/GCDKit" == 1.1.5 +github "Dschee/GCDKit" "feature/tvOS_support" diff --git a/Cartfile.resolved b/Cartfile.resolved index 568d159..ab424eb 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "JohnEstropia/GCDKit" "1.1.5" +github "Dschee/GCDKit" "c6ce8a18ba052204ab7b2d80ce1b0f1247b4c200" diff --git a/Carthage/Checkouts/GCDKit b/Carthage/Checkouts/GCDKit index f0ed149..c6ce8a1 160000 --- a/Carthage/Checkouts/GCDKit +++ b/Carthage/Checkouts/GCDKit @@ -1 +1 @@ -Subproject commit f0ed14911fccc36a60f10e7dbff1db844f560bd0 +Subproject commit c6ce8a18ba052204ab7b2d80ce1b0f1247b4c200 From 9081b36cca31a9a164b307221f52e7ea9af643d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 17 Jan 2016 13:30:45 +0100 Subject: [PATCH 12/17] Add tvOS target + Configure target + Add shared scheme for tvOS --- CoreStore.xcodeproj/project.pbxproj | 345 +++++++++++++++++- .../xcschemes/CoreStore tvOS.xcscheme | 99 +++++ 2 files changed, 443 insertions(+), 1 deletion(-) create mode 100644 CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index 72d80f3..42028c3 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -11,6 +11,72 @@ 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 */; }; + 82BA18E31C4BBE6700A0916E /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18E21C4BBE6700A0916E /* GCDKit.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 */; }; @@ -192,6 +258,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 */; @@ -217,6 +290,11 @@ 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 tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CoreStoreTests tvOS.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; }; + 82BA18E21C4BBE6700A0916E /* GCDKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GCDKit.framework; path = "Carthage/Checkouts/GCDKit/build/Debug-appletvos/GCDKit.framework"; sourceTree = ""; }; 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 = ""; }; B51BE0691B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectModel+Setup.swift"; sourceTree = ""; }; @@ -310,6 +388,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82BA18851C4BBCBA00A0916E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 82BA18E31C4BBE6700A0916E /* 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; @@ -358,6 +454,8 @@ B563216F1BD65082006C9394 /* CoreStore.framework */, B52DD1741BE1F8CC00949AFE /* CoreStore.framework */, B52DD17D1BE1F8CC00949AFE /* CoreStoreTests.xctest */, + 82BA18891C4BBCBA00A0916E /* CoreStore.framework */, + 82BA18921C4BBCBA00A0916E /* CoreStoreTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -418,12 +516,15 @@ 2F291E3119C6D4D3007AF63F /* Frameworks */ = { isa = PBXGroup; children = ( + 82BA18E21C4BBE6700A0916E /* GCDKit.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; @@ -574,6 +675,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82BA18861C4BBCBA00A0916E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 82BA18A01C4BBD1400A0916E /* CoreStore.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B52DD1711BE1F8CC00949AFE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -629,6 +738,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 tvOS.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; B52DD1731BE1F8CC00949AFE /* CoreStore OSX */ = { isa = PBXNativeTarget; buildConfigurationList = B52DD18C1BE1F8CD00949AFE /* Build configuration list for PBXNativeTarget "CoreStore OSX" */; @@ -689,7 +834,7 @@ 2F03A52719C5C6DA005002A5 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0710; + LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "John Rommel Estropia"; TargetAttributes = { @@ -699,6 +844,12 @@ 2F03A53A19C5C6DA005002A5 = { CreatedOnToolsVersion = 6.0; }; + 82BA18881C4BBCBA00A0916E = { + CreatedOnToolsVersion = 7.2; + }; + 82BA18911C4BBCBA00A0916E = { + CreatedOnToolsVersion = 7.2; + }; B52DD1731BE1F8CC00949AFE = { CreatedOnToolsVersion = 7.1; }; @@ -725,6 +876,8 @@ targets = ( 2F03A52F19C5C6DA005002A5 /* CoreStore iOS */, 2F03A53A19C5C6DA005002A5 /* CoreStoreTests iOS */, + 82BA18881C4BBCBA00A0916E /* CoreStore tvOS */, + 82BA18911C4BBCBA00A0916E /* CoreStoreTests tvOS */, B563216E1BD65082006C9394 /* CoreStore watchOS */, B52DD1731BE1F8CC00949AFE /* CoreStore OSX */, B52DD17C1BE1F8CC00949AFE /* CoreStoreTests OSX */, @@ -747,6 +900,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; @@ -846,6 +1013,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; @@ -979,6 +1221,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 */; @@ -1149,6 +1396,86 @@ }; name = Release; }; + 82BA189A1C4BBCBA00A0916E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Checkouts/GCDKit/build/Debug-appletvos", + ); + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "$(SRCROOT)/CoreStore/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = source.open.CoreStore; + PRODUCT_NAME = CoreStore; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Debug; + }; + 82BA189B1C4BBCBA00A0916E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Checkouts/GCDKit/build/Debug-appletvos", + ); + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "$(SRCROOT)/CoreStore/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = source.open.CoreStore; + PRODUCT_NAME = CoreStore; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Release; + }; + 82BA189C1C4BBCBA00A0916E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = CoreStoreTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "source.open.CoreStore-tvOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Debug; + }; + 82BA189D1C4BBCBA00A0916E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = CoreStoreTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "source.open.CoreStore-tvOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Release; + }; B52DD1851BE1F8CD00949AFE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1301,6 +1628,22 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 82BA189E1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStore tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 82BA189A1C4BBCBA00A0916E /* Debug */, + 82BA189B1C4BBCBA00A0916E /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 82BA189F1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStoreTests tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 82BA189C1C4BBCBA00A0916E /* Debug */, + 82BA189D1C4BBCBA00A0916E /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 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..3c6cdab --- /dev/null +++ b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d05522bb2045cd2b8bd6cc3df78109fe28bf1377 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 19 Jan 2016 11:38:11 +0900 Subject: [PATCH 13/17] tidy up, set default directory to Caches folder on tvOS --- .gitmodules | 2 +- .travis.yml | 19 ++--- Cartfile | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/GCDKit | 2 +- CoreStore.podspec | 5 +- CoreStore.xcodeproj/project.pbxproj | 71 ++++++++----------- .../xcschemes/CoreStore tvOS.xcscheme | 10 +-- CoreStore/Info.plist | 2 +- CoreStore/Migrating/CoreStore+Migration.swift | 10 +-- CoreStore/Migrating/DataStack+Migration.swift | 16 ++--- CoreStore/Setting Up/CoreStore+Setup.swift | 4 +- CoreStore/Setting Up/DataStack.swift | 16 +++-- CoreStoreTests/CoreStoreTests.swift | 2 +- README.md | 2 +- 15 files changed, 82 insertions(+), 83 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5b4a734..5fec53f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Carthage/Checkouts/GCDKit"] path = Carthage/Checkouts/GCDKit - url = https://github.com/Dschee/GCDKit.git + url = https://github.com/JohnEstropia/GCDKit.git diff --git a/.travis.yml b/.travis.yml index a7b0ea9..bd1e3e9 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 @@ -10,14 +10,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 diff --git a/Cartfile b/Cartfile index 9de2bb1..d8f515a 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "Dschee/GCDKit" "feature/tvOS_support" +github "JohnEstropia/GCDKit" == 1.1.7 diff --git a/Cartfile.resolved b/Cartfile.resolved index ab424eb..2c136d3 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "Dschee/GCDKit" "c6ce8a18ba052204ab7b2d80ce1b0f1247b4c200" +github "JohnEstropia/GCDKit" "1.1.7" diff --git a/Carthage/Checkouts/GCDKit b/Carthage/Checkouts/GCDKit index c6ce8a1..7f6b560 160000 --- a/Carthage/Checkouts/GCDKit +++ b/Carthage/Checkouts/GCDKit @@ -1 +1 @@ -Subproject commit c6ce8a18ba052204ab7b2d80ce1b0f1247b4c200 +Subproject commit 7f6b560ffd4ba0f7b1c6f1ec7e17d32928a9858b diff --git a/CoreStore.podspec b/CoreStore.podspec index 5898145..0174d76 100644 --- a/CoreStore.podspec +++ b/CoreStore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CoreStore" - s.version = "1.4.3" + 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 42028c3..7072c4b 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -76,11 +76,14 @@ 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 */; }; - 82BA18E31C4BBE6700A0916E /* GCDKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18E21C4BBE6700A0916E /* GCDKit.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 */; }; @@ -205,8 +208,6 @@ B56965241B356B820075EE4A /* MigrationResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56965231B356B820075EE4A /* MigrationResult.swift */; }; B59D5C221B5BA34B00453479 /* NSFileManager+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */; }; B5A261211B64BFDB006EB6D3 /* MigrationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A261201B64BFDB006EB6D3 /* MigrationType.swift */; }; - 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 */; }; @@ -291,12 +292,12 @@ 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 tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CoreStoreTests tvOS.xctest"; 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; }; - 82BA18E21C4BBE6700A0916E /* GCDKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GCDKit.framework; path = "Carthage/Checkouts/GCDKit/build/Debug-appletvos/GCDKit.framework"; sourceTree = ""; }; 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; }; @@ -315,7 +316,6 @@ B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFileManager+Setup.swift"; sourceTree = ""; }; B5A261201B64BFDB006EB6D3 /* MigrationType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationType.swift; sourceTree = ""; }; 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 = ""; }; 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 = ""; }; @@ -375,7 +375,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B5BDC91D1C2023CF008147CD /* GCDKit.framework in Frameworks */, + B519E4581C4CD2CA00E7B469 /* GCDKit.framework in Frameworks */, B5D39A0219FD00C9000E91BB /* Foundation.framework in Frameworks */, 2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */, ); @@ -392,7 +392,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 82BA18E31C4BBE6700A0916E /* GCDKit.framework in Frameworks */, + B519E4591C4CD2D100E7B469 /* GCDKit.framework in Frameworks */, 82BA18E11C4BBE2C00A0916E /* CoreData.framework in Frameworks */, 82BA18DF1C4BBE2600A0916E /* Foundation.framework in Frameworks */, ); @@ -410,7 +410,7 @@ 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 */, ); @@ -428,6 +428,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B519E45B1C4CD2ED00E7B469 /* GCDKit.framework in Frameworks */, B563217C1BD650E3006C9394 /* Foundation.framework in Frameworks */, B563217A1BD650DE006C9394 /* CoreData.framework in Frameworks */, ); @@ -455,7 +456,7 @@ B52DD1741BE1F8CC00949AFE /* CoreStore.framework */, B52DD17D1BE1F8CC00949AFE /* CoreStoreTests.xctest */, 82BA18891C4BBCBA00A0916E /* CoreStore.framework */, - 82BA18921C4BBCBA00A0916E /* CoreStoreTests tvOS.xctest */, + 82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */, ); name = Products; sourceTree = ""; @@ -516,8 +517,7 @@ 2F291E3119C6D4D3007AF63F /* Frameworks */ = { isa = PBXGroup; children = ( - 82BA18E21C4BBE6700A0916E /* GCDKit.framework */, - B5BDC91C1C2023CF008147CD /* GCDKit.framework */, + B519E4571C4CD2CA00E7B469 /* GCDKit.framework */, B5548CD71BD65AE50077652A /* CoreData.framework */, B56321791BD650DE006C9394 /* CoreData.framework */, 82BA18E01C4BBE2C00A0916E /* CoreData.framework */, @@ -771,7 +771,7 @@ ); name = "CoreStoreTests tvOS"; productName = "CoreStore tvOSTests"; - productReference = 82BA18921C4BBCBA00A0916E /* CoreStoreTests tvOS.xctest */; + productReference = 82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; B52DD1731BE1F8CC00949AFE /* CoreStore OSX */ = { @@ -1283,6 +1283,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; @@ -1326,6 +1327,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 = ""; @@ -1346,6 +1348,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; @@ -1363,6 +1366,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; @@ -1371,7 +1375,6 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -1380,6 +1383,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; @@ -1388,76 +1392,62 @@ 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 = { - DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Checkouts/GCDKit/build/Debug-appletvos", - ); GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "$(SRCROOT)/CoreStore/Info.plist"; + 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 = source.open.CoreStore; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CoreStore; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.1; }; name = Debug; }; 82BA189B1C4BBCBA00A0916E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Checkouts/GCDKit/build/Debug-appletvos", - ); GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "$(SRCROOT)/CoreStore/Info.plist"; + 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 = source.open.CoreStore; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CoreStore; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.1; }; name = Release; }; 82BA189C1C4BBCBA00A0916E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - DEBUG_INFORMATION_FORMAT = dwarf; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = CoreStoreTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "source.open.CoreStore-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CoreStoreTests; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.1; + TARGETED_DEVICE_FAMILY = 3; }; name = Debug; }; @@ -1465,14 +1455,13 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = CoreStoreTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "source.open.CoreStore-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = "com.johnestropia.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CoreStoreTests; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.1; + TARGETED_DEVICE_FAMILY = 3; }; name = Release; }; @@ -1635,6 +1624,7 @@ 82BA189B1C4BBCBA00A0916E /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 82BA189F1C4BBCBA00A0916E /* Build configuration list for PBXNativeTarget "CoreStoreTests tvOS" */ = { isa = XCConfigurationList; @@ -1643,6 +1633,7 @@ 82BA189D1C4BBCBA00A0916E /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; B52DD18C1BE1F8CD00949AFE /* Build configuration list for PBXNativeTarget "CoreStore OSX" */ = { isa = XCConfigurationList; diff --git a/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme index 3c6cdab..6e7165c 100644 --- a/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme +++ b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore tvOS.xcscheme @@ -15,7 +15,7 @@ @@ -33,7 +33,7 @@ @@ -43,7 +43,7 @@ @@ -65,7 +65,7 @@ @@ -83,7 +83,7 @@ diff --git a/CoreStore/Info.plist b/CoreStore/Info.plist index f517fce..e22a0c5 100644 --- a/CoreStore/Info.plist +++ b/CoreStore/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.4.3 + 1.4.4 CFBundleSignature ???? CFBundleVersion 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/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 8145313..33a58b0 100644 --- a/CoreStoreTests/CoreStoreTests.swift +++ b/CoreStoreTests/CoreStoreTests.swift @@ -381,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 b7f579e..29a0581 100644 --- a/README.md +++ b/README.md @@ -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: From 83a04e669e297fc9bae35f9da2b173387b78d894 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 19 Jan 2016 11:55:22 +0900 Subject: [PATCH 14/17] updated .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd1e3e9..326a126 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,8 @@ script: 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 clean 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 clean 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 From 087480a3a8f1153552df8196bd488a72472bd827 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 19 Jan 2016 12:22:14 +0900 Subject: [PATCH 15/17] update cartfile --- CoreStore/CartFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CoreStore/CartFile b/CoreStore/CartFile index a8ee2b6..d8f515a 100644 --- a/CoreStore/CartFile +++ b/CoreStore/CartFile @@ -1 +1 @@ -github "JohnEstropia/GCDKit" == 1.1.5 +github "JohnEstropia/GCDKit" == 1.1.7 From 0c6246475a3feb37a414bde0ade2e5d93b5301cb Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 19 Jan 2016 12:24:14 +0900 Subject: [PATCH 16/17] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29a0581..31c3907 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # CoreStore -[![Build Status](https://img.shields.io/travis/JohnEstropia/CoreStore/develop.svg)](https://travis-ci.org/JohnEstropia/CoreStore) +[![Build Status](https://img.shields.io/travis/JohnEstropia/CoreStore/master.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) From fc83180af80b8e2a69a6384c2f7bbf0cbf4880d7 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 19 Jan 2016 12:25:58 +0900 Subject: [PATCH 17/17] updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29a0581..980343a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # CoreStore -[![Build Status](https://img.shields.io/travis/JohnEstropia/CoreStore/develop.svg)](https://travis-ci.org/JohnEstropia/CoreStore) +[![Build Status](https://img.shields.io/travis/JohnEstropia/CoreStore.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)