I have a working code that works but deprecated:
This part is fine:
let archived = try? NSKeyedArchiver.archivedData(withRootObject: [defaultRecor
The usage of the new API to archive an array is a bit tricky.
You could have figured it out yourself if you wouldn't ignore the errors with try?
The method above didn't worked for me for unarchiving, I did this and it worked:
NSKeyedUnarchiver.unarchivedObject(ofClasses: [Record.self], from: archived)