I am updating some of my code which has been deprecated in IOS12.
Below is the old code:
let gameData : NSMutableData = NSMutableData()
let archiver = NSKeyedArchiver(forWritingWith: gameData)
archiver.encode(MatchInformationValues.currentMatchInfo, forKey: "MatchData")
archiver.encode(CurrentGameState.currentGameStatus, forKey: "GameData")
archiver.finishEncoding()
The new code that works with IOS12 is:
let archiver = NSKeyedArchiver(requiringSecureCoding: false)
archiver.encode(MatchInformationValues.currentMatchInfo, forKey: "MatchData")
archiver.encode(CurrentGameState.currentGameStatus, forKey: "GameData")
archiver.finishEncoding()
let gameData = archiver.encodedData
I am trying to understand the "requiringSecureCoding:" property. When do you set it to true and when to use false? My data is just a dictionary containing game data, so it seems like I should use false, but this is just a guess. Apple's documentation does not give any guidance when to use true or false. Any insight would be appreciated.