'How to use NSKeyedUnarchiver.unarchiveObject

I have a working code but that was deprecated.

The following part of the code is the line with a warning.

let dict = NSKeyedUnarchiver.unarchiveObject(with: outData) as! NSDictionary the following code is the warning that I got

'unarchiveObject(with:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead

I don't have any idea about the working of this unarchivedObjectOfClass:fromData:error:

I need to remove this warning, anyone has any idea about this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source