I’m converting my app from ASIHTTPRequest to AFNetworking. What should I know, in broad strokes, about how these two frameworks are different and how my app should be structured differently? For example one thing that I have found is that ASIHTTPRequest is based around @selectors, and AFNetworking is based around GCD blocks.
I’m converting my app from ASIHTTPRequest to AFNetworking. What should I know, in broad
Share
You’ve already mentioned the most important part; the difference between delegate methods of ASI and blocks in AFN.
If you implemented the ASI methods in many different classes it’s fairly straightforward to move those chunks into blocks inside the same classes when you switch to AFN. Otherwise, if you’ve implemented some grand class which deals with all your ASI networking, be prepared to copy and paste it into the calling classes. Overall, this should benefit you greatly as it reduces the amount of navigating you have to do when following the codepaths for your networking logic.
Also, if you’ve effectively written a wrapper against an API in ASI, you may want to consider subclassing AFHTTPClient and implementing common logic in such a subclass.