gimenete/iOS-boilerplate — pull request #17 by mattt (2011-10-31 15:52:53+00:00)
Title: Remove Image Manager and BaseViewController; Add Twitter Search Client

Hi Alberto,

Thanks so much for choosing AFNetworking to replace ASIHTTPRequest in your iOS Boilerplate. I hope you've found it nice to work with so far.

Looking through your use of AFNetworking in the project, I have a few suggestions (with patchesI) for how to reduce and clean up the code a bit. These suggestions stem from a difference in how ASI is used as compared to AF.

1. __Remove Image Manager__: Image Manager duplicates functionality of AFImageRequestOperation and UIImageView+AFNetworking. As it currently stands, it's an unnecessary middle-man that interfaces through a very similar API.

2. __Remove BaseViewController__: BaseViewController is another vestige of ASI. Methods like `-requestWithURL:` and `mutableRequestWithURL:` provide little advantage over simply using the class constructors from `NSURLRequest` and `NSMutableURLRequest`. Likewise, the different request methods are sort of an anti-pattern. For single requests, those operation objects should simply use the class constructors defined in the class (e.g. `AFJSONRequestOperation +JSONRequestOperationWithRequest:success:failure`. For things like requesting data from the same API (like Twitter, see point 3), AFHTTPClient handles that just fine. I would strongly advise against the current use of AFNetworking in the controllers for these reasons.

3. __Add Twitter Search Client__: Since several of the examples talk to the Twitter Search API, it makes sense to use AFHTTPClient, a feature of AFNetworking specifically for this purpose.

I look forward to hearing your thoughts on these changes.