One popular scenario in using blocks is when you need to update your view after a web service call is finished.
Hi Everyone! It has been a very long while since I last posted in this blog. This time, I will be making a tutorial in using blocks when we are accessing our API or web services. Disclaimer: I am also not that 'expert' when it comes to blocks. But I have learned this method throughout my career as an iOS Developer. This is a combination of what I learned from my senior teammates. By the way, I am using the AFNetworking Framework. Set up... 1. Create a singleton-patterned APIClient class which is a subclass of AFHTTPClient. 2. Our APIClient interface file should look like this... #import <Foundation/Foundation.h> #import "AFHTTPClient.h" @interface APIClient : AFHTTPClient + ( APIClient *)sharedClient; @end 3. And in our implementation file: #import "APIClient.h" #import "Constants.h" @implementation GCAPIClient /** We usually have our Development and Production API links, right? So to cate