After watching 's Controlling Complexity talk, all of my Swift classes instantly became structs and now I am rich.
Conversation
yeaaaa boi live that nonprofit lifestyle
1
*pours glass of cleanskin red wine* Represent!
1
1
The only thing I’m unsure about is how would you implement core data/realm with structs, as they require NSObjec
3
1
1
They have a mistaken conceptual model; ORMs are a trap. Control data flow explicitly, think of records, not objects.
4
2
7
exactly. Is it risky to extend NSCoder to archive your structs? (Being a class cluster etc)
1
Replying to
Yes. But you can make e.g. class FooCodingAdapter: NSCoding { init(foo: Foo); let foo: Foo }
Replying to
of course. I might look into that with YapDB. You can provide your own serializers.
Replying to
took me a little while, but I finally open sourced my framework to do this! See danthorpe.me/posts/yap-data
1



