Friday November 04, 2011

AFNetworking

I’ve recently fallen in love with Gowalla’s AFNetworking library.

Choosing open source libraries is tough. I used to use ASIHTTPRequest since it has some nice content handling and functionality wrapping, but it’s large and can be difficult to follow if you want to extend it. I abandoned it and decided to go with raw NSURLRequests, which is already a pretty nice abstraction that Apple came up with.

But when it’s time to process content coming back from the server, I wanted to build a content type handler and found AFNetworking does pretty much what I would have made. It’s a thinner layer on top of NSURLRequest than ASIHTTPRequest which means a lot when you have to debug a library yourself.

Using an open source library in your code means you “own” it and have to support what it does for you. I prefer the simplest libraries. I don’t want to waste time messing with other peoples abstractions if I can get away with it.