Skip to content

Settings

Johan Degraeve edited this page Mar 9, 2019 · 11 revisions

Summary

Settings are stored in UserDefaults, see xdrip/View Controllers/SettingsViewController/View Models/UserDefaults+Settings.swift

Add a setting

Update UserDefaults

Update file xdrip/View Controllers/SettingsViewController/View Models/UserDefaults+Settings.swift

add a value to the enum Key

add a computed property to get and set the value with the expected type

Update UserDefaults, existing Section in Settings Page

To add a setting to an existing Section in the Settings Page.

In the folder xdrip/View Controllers/SettingsViewController/View Models there's a ViewModel per section that can appear in a settings page.

Extend the enum Setting