I want to upgrade to the latest version of AFNetworking. I was wondering how to download a PDF file from the server in order to display it in my application.
In the old version, I used this code:
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; operation.responseSerializer = [AFHTTPResponseSerializer serializer]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { [webView loadData:responseObject MIMEType:@"application/pdf" textEncodingName:nil baseURL:nil]; } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
What does the code look like in AFNetworking 2.0 to do the same job? Should I use a different AFNetworking class?
source share