Hello, I am working on a screen time manager that can block certain apps. I want this to work by allowing a certain number of 5-minute sessions per day. For each app the user selects, I would like to store the number of sessions remaining for that app in a dictionary. Currently, I am storing them in a dictionary of type <AppToken: Int>
. However, I would like to store this dictionary to UserDefaults
, and it doesn't seem like it is possible to store the type AppToken
to UserDefaults
. I was wondering how I could go about storing the AppToken
as a String
and maybe saving to UserDefaults
as a <String: Int>
instead? Thanks.