Closed karstengresch closed 6 years ago
Hey @karstengresch :)
Happy that you are enjoying Graph. Are you talking about the Swift 4.2 dynamic properties so you don't have to access the API using subscripting? If so, the second I heard about this update... I was like "finally".
@danieldahan I think he wants us to make Entity
type conform to Codable
. This great idea because swift struct
s with Codable
get implicit conformance by the compiler without any need for explicitly conformance to Codable
by the developer if and only if all struct members conform to Codable
.
@danieldahan @OrkhanAlikhanov Thanks for your replies - @OrkhanAlikhanov is right: I just think of conformance to Codable
.
This would e.g. allow putting an Entity
object into a Codable
conformant struct
(part of a larger data model) that gets locally persisted as a replacement for UserDefaults
.
Not sure if this makes sense for you @danieldahan ?
Best wishes,
Karsten
@karstengresch Yes it does. I think this should be doable. Let's leave this request up for now and tackle it within the next week, @OrkhanAlikhanov. Thank you!
@karstengresch in what cases would you use Entity
as Codable
? Can you elaborate more on your above example?
Base solution is here https://github.com/CosmicMind/Graph/pull/152#pullrequestreview-146460462, although, we have more we would like to add feature wise. We will make a new issue to articulate the new issues.
@OrkhanAlikhanov, @danieldahan - thanks for making this happen! You guys really rock.
@OrkhanAlikhanov regarding your question: I started using Codable
instead of UserDefaults
and want to integrate an entire Graph
as part of a struct
which then is persisted via Codable and synchronized via CloudKit
.
Of course I'm aware there's GraphJSON
w/ serialization and Graph
w/ built-in CloudKit
support, but in my case the entire struct with it's different nested elements would hardly be manageable for me w/ Graph
. Makes sense?
Anyway - @OrkhanAlikhanov thank you so much for your pull request and @danieldahan to let it get into the code base!
@karstengresch Keep the great requests/questions coming and we will work to improve our products :) Thank you!
Hi all, especially Daniel :)
I'm in a need including Entity vars in a struct that conforms to Codable (as of Swift 4).
Not sure if that makes sense in regards to the Graph API philosophy, but to me, that'd be useful as I wouldn't need to remodel the Entity's structure.
Thanks for Graph anyway - what a decent piece of great software!
Best wishes,
Karsten