Trying to make software development less painful and more fun one repository at a time.
If you have any questions or would like to get in contact please feel free to open an issue or find me on twitter.
Modern interface to UserDefaults + Codable support
License: MIT License
Trying to make software development less painful and more fun one repository at a time.
If you have any questions or would like to get in contact please feel free to open an issue or find me on twitter.
For example
UserDefaults.standard.rx.observe(UserModel.self, "key").subscribe(onNext: { (model) in print(model) }).disposed(by: dis)
is not working.
because observe is Data
,
Thx
Thanks for this excellent library,
I have been using this library with the UserDefaults(suiteName:
but I am facing issues in removing all values by removePersistentDomain
.
Is it recommended to use it with UserDefaults(suiteName:
?
Also can we have remove All or remove feature
Cheers
Hi,
I have an array of UserObject
. How can i write and read [UserObject]
to UserDefaults
?
For example, in my app version 1.1, there is a struct:
struct A: Codable, DefaultStorable {
var aMember:Int
}
A.write() // ok
In my new version 1.2, the struct has new member:
struct A: Codable, DefaultStorable {
var aMember:Int
var aNewMember:Int
}
let a = A.read() // -> nil
Could you please add some way to support migrating old data to new data structure? Some user callbacks, maybe?
Right now I have to do it like this:
if let a = A.read() {
self.a = a;
} else if let a1_1 = A1_1.read(forKey: "A.Type") {
a = A();
a.aMember = a1_1.aMember;
}
Hi,
Not sure if this is chance or not, but it happened to me twice that fetch crashed after the model (variables) of my class changed. Since changing the model on upgrades is a fairly common thing, I wonder if this can be somehow avoided/repaired?
Hey!
First of all, thank you for your hard work.
Could you please release a new version containing the static version of clear?
Thanks,
Andor
What would the proper method for clearing a stored object?
Would be nice to have:
var me: User? = nil
me = User(...)
me.write()
....
//logout
me.clear()
print(me) --> nil
me.read() --> nil
DefaultStorable
Instead of:
static func fetchFromDefaults(key: String?) -> Self?
func storeToDefaults(key: String?)
I think we should have:
static func fetch(key: String?) -> Self?
func store(key: String?)
Or maybe also have the parameter unnamed, not exactly sure on that yet.
What do you think about it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.