Open jmburges opened 9 years ago
Hey @jmburges -- this makes a lot of sense. As DS begins to build a CocoaPod for the API... do you think it'd make sense to add the Term and Reportback classes into it? (I'd think so.. but.. not sure if best practice to let devs create their own classes... or just do the lifting for them )
this stuff is all over the place btw.
@aaronschachter so this is a very tough decision. Some people say just provide NSDictionary
objects, other say provide the NSObject. My opinion is to provide the classes, but still have the APIClient spit out NSDictionaries. That way if people don't need all of the properties given by the API or they are going to be using NSManagedObject
subclasses (for Core data) they still get the api benefits. Does that make sense?
Yep, it does, thanks for the input, @jmburges. Starting to read up on creating a CocoaPod to close this one by using a class the pod will provide.
So it seems in your inbox and the detail view controller you have this terms
NSMutableDictionary
. This seems like it wants to be made into a proper object with the properties that you need. Then I would add a class method to that object called something likecreateTermFromDictionary:
that converts the dictionary coming form the api to the object. We do this for a few reasons:NSString
keys is annoying and doesn't get any autocomplete love