Manage UserDefaults Keys with Enum

UserDefaults is commonly used to store simple persistence data or state. But, improper key management would lead to future major problem and code messiness. Moreover, sometimes the typo of key name might result to untraced bugs.

Therefore, let’s try to manage the UserDefaults keys in a cleaner way using Enum (Enumeration). Enum is a…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store