remove thread asserts when creating new transactions. fixes https://github.com/JohnEstropia/CoreStore/issues/6

This commit is contained in:
John Estropia
2015-07-09 18:55:35 +09:00
parent c1967ecdd3
commit 929fdfd9a9

View File

@@ -41,8 +41,6 @@ public extension DataStack {
*/
public func beginAsynchronous(closure: (transaction: AsynchronousDataTransaction) -> Void) {
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
AsynchronousDataTransaction(
mainContext: self.rootSavingContext,
queue: self.childTransactionQueue,
@@ -57,8 +55,6 @@ public extension DataStack {
*/
public func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
return SynchronousDataTransaction(
mainContext: self.rootSavingContext,
queue: self.childTransactionQueue,
@@ -72,8 +68,6 @@ public extension DataStack {
*/
public func beginDetached() -> DetachedDataTransaction {
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
return DetachedDataTransaction(
mainContext: self.rootSavingContext,
queue: .Main)