Overview
This function stores a value in UserDefaults for the provided key, allowing data persistence between app sessions.
Parameters
setUserDefault(key, value)
Key
The string key to associate with the stored value.
Value
The value to store (can be string, number, boolean, etc.).
For example...
setUserDefault("username", "john_doe")
Stores "john_doe" with the key "username".