Swift 4 support

This commit is contained in:
John Estropia
2017-06-09 11:25:28 +09:00
parent f618617053
commit 6e01a58c85
17 changed files with 116 additions and 69 deletions

View File

@@ -54,12 +54,15 @@ public final class CSAsynchronousDataTransaction: CSBaseDataTransaction, CoreSto
!self.bridgeToSwift.isCommitted,
"Attempted to commit a \(cs_typeName(self)) more than once."
)
self.bridgeToSwift.autoCommit { (result) in
self.bridgeToSwift.autoCommit { (_, error) in
switch result {
if let error = error {
case (_, nil): success?()
case (_, let error?): failure?(error.bridgeToObjectiveC)
failure?(error.bridgeToObjectiveC)
}
else {
success?()
}
}
}