-
-
Notifications
You must be signed in to change notification settings - Fork 70
Allow implementations of ParseObjects to set their own className #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for opening this issue!
|
struct MyClientClassName: PareseObject {
static var className: String {
"MyServerClassName"
}
}
I’m not sure what you mean by “a lot of work,” but I recommend learning more about |
Hi, thank you for this!
So here's some sample code from our project
From reading the initial docs and playground code, it seems like I can't just say
or even anymore, without declaring
and then changing it to
with something on the order of 30 classes, and rapid changing of these classes, it seems like this is a huge amount of overhead just to add variables to a ParseObject? I'll read the evolution plan in a bit, but this is what I first gathered from looking at the docs - it seems like the final change would look something like
|
In your examples you are using You don't need to force unwrap every property, depending on how you code, you can try get() The README and the API docs state:
It's important to treat it as such. The Swift SDK doesn't derive from the Objective-C SDK. If you want similar behavior, you will need to create a separate SDK (that new SDK can possibly depend on the Swift SDK to reuse "some" code) and design it to behave with reference types and re-write the whole REST API layer. The other route would be to fix/improve the Objective-C SDK. I will not be able to assist with additional suggestions or designing for either of those routes as:
|
Not actually - as I stated in my original code snippet:
Since we never in practice use
I understand this, I was just answering your earlier comment on
because the two are completely different in design philosophy and architecture, having to write a lot of wrappers for each and every database class seems... a little heavy-handed? But again, thank you for taking the time to reply! I appreciate it. |
If you really want to treat your |
Got it! Thank you so much!!! |
Current Limitation
struct extensions of ParseObject seem to force their name as the classTitle
struct GameScore: ParseObject { ... }
We use Stripe as another library - Stripe has a class called Event. One of the tables in our database that is heavily populated is already called Event.
Feature / Enhancement Description
Allow extensions of ParseObject to function more like PFObject. While it's a lot of work for us to have to add in
struct SomeDatabaseTableName: ParseObject { ... }
this is not impossible, albeit just a lot of boilerplate code.
Example Use Case
Alternatives / Workarounds
We could migrate the entire table into a new one and update all of the code to point to a new table, but that would still leave us at the mercy of any of our dependencies adding in a new class or struct that conflicts with ours.
3rd Party References
The original obj-c Parse SDK
The text was updated successfully, but these errors were encountered: