Skip to content

EmadBeyrami/SwiftDataManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

User Default Property Wrapper (Data Manager) in Swift

A best practice codebase for saving data in in user defaults using a @propertywrapper you can save any types of data into user defaults using this code

Feature

  • Codable Friendly
  • Generic
  • Clean
  • Much less code

Usage

  1. Copy these two swift files in your project.
  2. add values you want to save in DataManager file.
  3. add a setter like the example.
  4. for getting a value you can either write a getter or just call the variable you add like:
let data = DataManager.shared.dataYouWantToSave

Buy me a coffee:

paypal crypto

Releases

No releases published

Packages

No packages published

Languages