Settings code has been completely reworked to support multiple settings sources.
Setting can now be loaded from UserDefaults. This enables the configuration from the configuration profile delivered by the MDM. Setting from the configuration file take precedence over the settings obtained using the UserDefaults.
The code is not super elegant. There are a lot of lines and duplicity but I think it is a tradeoff for my goal. After Settings() initialisation I want to end up with the valid setting values inside class variables. To achieve shorter code I would have to use dictionaries with Any type. I don't want to deal with the type or optionals with nil values. With the limited feature set of this project I think simple non-elegant is better than complicated.
Settings code has been completely reworked to support multiple settings sources.
Setting can now be loaded from
UserDefaults
. This enables the configuration from the configuration profile delivered by the MDM. Setting from the configuration file take precedence over the settings obtained using theUserDefaults
.The code is not super elegant. There are a lot of lines and duplicity but I think it is a tradeoff for my goal. After Settings() initialisation I want to end up with the valid setting values inside class variables. To achieve shorter code I would have to use dictionaries with Any type. I don't want to deal with the type or optionals with nil values. With the limited feature set of this project I think simple non-elegant is better than complicated.
Closes #7