r/ObjectiveC • u/davidsiegel • Jan 16 '18
Paste JSON, instantly get Objective-C models and code without dependencies
https://app.quicktype.io/#l=objc
5
Upvotes
r/ObjectiveC • u/davidsiegel • Jan 16 '18
3
u/davidsiegel Jan 16 '18
quicktype infers types from JSON data, then outputs Swift, Objective-C, and code in other languages for reading that data. You can also input JSON Schema and GraphQL queries using our CLI.
We just added Objective-C output support today, and we're looking for feedback. We already have some improvements in mind but we'd also love any feedback on the generated code, or what we could improve.
Thank you!
1
u/ohd Jan 30 '18
Really like this and is the best of its kind that I've seen. Thank you for making it.
I am however still struggling a bit to figure out how to approach using it to generate code that replaces my existing handwritten brittle data model. I have two few questions that might help:
2.Do you have suggestions about how to provide hints to improve class names? The guesses are not always great. In one case I'm seeing the class name chosen is a unique string that is used to identify a particular instance of a class instead of the class type. Instead of "Class Car" it's "Class XYZ" where XYZ is the Vin number of a specific car.
And finally a syntax nitpick. There isn't always a space between the "+" or "-" and the method that follows. I noticed this is the case for code generated for "+(NSDictionary<NSString *, NSString *> *)properties" and "-(void)setValue:(nullable id)value forKey:(NSString *)key" totally minor thing, but It bothers me and I can't imagine it's hard to fix.
Thanks again!
2
u/PixelBot Jan 16 '18
This is surprisingly useful, solves a problem for me, saves time in making boilerplate. Nice.