Closed Maschina closed 5 months ago
It would be better if it accepted a string name as the default
key (or previousName
as a better name), since then you don't have to use two Defaults.Key
. You just rename the existing Defaults.Key
property name and then refer to the old UserDefaults name in the previousName
parameter. That being said, I'm not even sure this init carries its own weight as you can generally just keep the UserDefaults string name while renaming the Defaults.Key
property. I do that all the time. Much easier.
Proposal to create a key with another key as default value. This can be useful if you want to change the name of the key, but still provide support to migrate from the previous key name.