DoSomethingArchive / ios-RBReviewer

0 stars 0 forks source link

Create a Term NSObject #31

Open jmburges opened 9 years ago

jmburges commented 9 years ago

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 like createTermFromDictionary: that converts the dictionary coming form the api to the object. We do this for a few reasons:

aaronschachter commented 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 )

jmburges commented 9 years ago

this stuff is all over the place btw.

jmburges commented 9 years ago

@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?

aaronschachter commented 9 years ago

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.