samsymons/RedditKit — pull request #53 by ealimam (2014-10-12 06:47:59+00:00)
Title: Complete the functionality to support the MoreComments API. Additions to...

... general comments fetching as well. Enhancements in this commit include:

• Deserialize MoreComments API reponse JSON into true RKComments and RKMoreComments. Just like the JSON returned from the reddit API, the result is a mixed-type RKComments/RKMoreComments object array.
• Add ability to limit number of comments returned on the "comments/%@.json" API. Default limit is 200 comments. The MoreComments API, on the other hand, returns 20 RKComments (plus a trailing RKMoreComments) regardless of any specified limit.
• Use RKArrayCompletionBlock (which doesn't use RKPagination) instead of RKListingCompletionBlock, since the concept of pagination doesn't exist for comments (there's the MoreComments API for that).
• Add gilded, parent_id, subreddit, and subreddit_id JSON/Obj-C property key-value pairs to RKComment.m for Mantle deserialization. parent_id is particularly useful so we know who the parent comment is after the MoreComments API returns with new comments for us to display.
• Update RKComment description method to provide a more rich summary.
• Rename RKMoreComment property name "parentFullName" to "parentID" to match the reddit JSON property name as well as the property name already in RKComment. This helps when parsing an API response array containing both RKComments and RKMoreComments. Both are now named parentID.
• Rename RKMoreComment property name "childIdentifiers" to "children" to match reddit API JSON name as well.
• Remove actualFullName property name on RKMoreComments because we set the inherited fullName property (from RKThing) to data.name when the JSON is deserialized using Mantle. This fullName value (data.name) is used when actually fetching MoreComments using the "api/morechildren.json" API.
• Add a couple helper methods in RKClient+Request to facilitate the actual network calls to the MoreComments API, as well as fetching a listing that doesn't require pagination (i.e. now RKArrayCompletionBlock instead of RKListingCompletionBlock).