I get a code-time yellow warning message in Xcode that says:
'unarchiveObject(with:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead
... when I use the following code:
let oldUbiquityIdentityToken = NSKeyedUnarchiver
.unarchiveObject(with: oldDataUbiquityIdentityToken!)
When I change to unarchivedObject(ofClass:from:) I get 2 code-time red error messages before I even fill in the arguments:
'NSCoding' cannot be used as a type conforming to protocol 'NSCoding' because 'NSCoding' has static requirements
Static method 'unarchivedObject(ofClass:from:)' requires that 'NSCoding' inherit from 'NSObject'
Here is the code afterwards before I fill in the parameters:
let oldUbiquityIdentityToken = NSKeyedUnarchiver.unarchivedObject(ofClass: NSCoding.Protocol, from: Data)
Why am I getting these error messages?