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

Commit 4a6ca51

Browse files
committed
Improved CKRecord Number Parsing
1 parent 7eb8fe9 commit 4a6ca51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/CKRecord.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ extension CKRecord {
267267
}
268268

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

@@ -279,6 +278,10 @@ extension CKRecord {
279278
default:
280279
return number
281280
}
281+
case let intValue as Int:
282+
return NSNumber(value: intValue)
283+
case let doubleValue as Int:
284+
return NSNumber(value: doubleValue)
282285

283286
case let dictionary as [String: Any]:
284287
switch type {
@@ -341,9 +344,6 @@ extension CKRecord {
341344
} else {
342345
return nil
343346
}
344-
#else
345-
return nil
346-
#endif
347347
}
348348

349349

0 commit comments

Comments
 (0)