Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Commit

Permalink
Improved CKRecord Number Parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyKJohnson committed Nov 30, 2016
1 parent 7eb8fe9 commit 4a6ca51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/CKRecord.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ extension CKRecord {
}

static func getValue(forRecordField field: [String: Any]) -> CKRecordValue? {
#if !os(Linux)
if let value = field[CKRecordFieldDictionary.value],
let type = field[CKRecordFieldDictionary.type] as? String {

Expand All @@ -279,6 +278,10 @@ extension CKRecord {
default:
return number
}
case let intValue as Int:
return NSNumber(value: intValue)
case let doubleValue as Int:
return NSNumber(value: doubleValue)

case let dictionary as [String: Any]:
switch type {
Expand Down Expand Up @@ -341,9 +344,6 @@ extension CKRecord {
} else {
return nil
}
#else
return nil
#endif
}


Expand Down

0 comments on commit 4a6ca51

Please sign in to comment.