Skip to content

Commit

Permalink
More removed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jaanus committed Mar 27, 2023
1 parent 1c66adf commit ea7dba6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public struct CloudKitCursorArchive: Codable {

public var cursor: CKQueryOperation.Cursor? {
do {
let decodedRecord = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data)
return decodedRecord as? CKQueryOperation.Cursor
let decodedRecord = try NSKeyedUnarchiver.unarchivedObject(ofClass: CKQueryOperation.Cursor.self, from: data)
return decodedRecord
} catch {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public struct CloudKitRecordIDArchive: Codable {

public var recordIDs: [CKRecord.ID] {
do {
let decodedRecords = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data)
return decodedRecords as? [CKRecord.ID] ?? []
let decodedRecords = try NSKeyedUnarchiver.unarchivedArrayOfObjects(ofClass: CKRecord.ID.self, from: data)
return decodedRecords ?? []
} catch {
return []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public struct CloudKitServerChangeTokenArchive: Codable {
private let data: Data

public var token: CKServerChangeToken {
let decodedRecord = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data)
return decodedRecord as! CKServerChangeToken
let decodedRecord = try! NSKeyedUnarchiver.unarchivedObject(ofClass: CKServerChangeToken.self, from: data)!
return decodedRecord
}

public init(token: CKServerChangeToken) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public struct CloudKitSubscriptionArchive: Codable {
private let data: Data

public var subscription: CKSubscription {
let decodedRecord = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data)
return decodedRecord as! CKSubscription
let decodedRecord = try! NSKeyedUnarchiver.unarchivedObject(ofClass: CKSubscription.self, from: data)!
return decodedRecord
}

public init(subscription: CKSubscription) {
Expand Down

0 comments on commit ea7dba6

Please sign in to comment.