leandro
03/23/2023, 4:07 PMrusshwolf
03/23/2023, 4:11 PMleandro
03/23/2023, 4:20 PMleandro
04/13/2023, 8:48 PMval newDelegate = NSUserDefaults(suiteName = NEW)
val migrationKey = "didMigrate"
// Emptying the old delegate and checking for its size does not work, so create a migrationKey.
if (!destination.boolForKey(migrationKey)) {
val source = NSUserDefaults(suiteName = OLD)
for ((key, value) in source.dictionaryRepresentation()) {
destination.setValue(value, forKey = key as String)
}
destination.setBool(true, migrationKey)
}