navjotsp / userdefaulthelperclass Goto Github PK
View Code? Open in Web Editor NEWThe problem we’ll face is we’ll have to remember the key values i.e “userId”. If we want to fetch userId in any part of our code, we need to remember that there is a key named “userId”. This can get cumbersome if there’re several developers in the same project as we’ll have to remember the key values. So We'll create a generic helper class to set, retrieve and remove data in UserDefaults using Enums.