Skip to content

Commit

Permalink
[Example] Use new AFNetworking APIs
Browse files Browse the repository at this point in the history
Avoid deprecated APIs.
  • Loading branch information
mrackwitz committed Dec 29, 2015
1 parent 7f79a43 commit e8df27b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Example/MRAFNetworkingSupportViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ - (void)viewDidLoad {
}

- (NSURLSessionDownloadTask *)bytesDownloadTask {
NSProgress *downloadProgress = nil;
NSURLSessionDownloadTask *task = [self.sessionManager downloadTaskWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"/bytes/1000000" relativeToURL:self.sessionManager.baseURL]]
progress:&downloadProgress
progress:nil
destination:nil
completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error){
NSLog(@"Task completed with error: %@", error);
Expand All @@ -56,6 +55,7 @@ - (NSURLSessionDownloadTask *)bytesDownloadTask {
- (IBAction)onActivityIndicatorGo:(id)sender {
NSURLSessionDataTask *task = [self.sessionManager GET:@"/delay/3"
parameters:nil
progress:nil
success:nil
failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Task %@ failed with error: %@", task, error);
Expand All @@ -71,6 +71,7 @@ - (IBAction)onCircularProgressViewGo:(id)sender {
- (IBAction)onOverlayViewGo:(id)sender {
NSURLSessionDataTask *task = [self.sessionManager GET:@"/delay/2"
parameters:nil
progress:nil
success:nil
failure:^(NSURLSessionDataTask *task, NSError *error) {
if ([error.domain isEqualToString:NSURLErrorDomain] && error.code == NSURLErrorCancelled) {
Expand Down Expand Up @@ -138,6 +139,7 @@ - (IBAction)onOverlayViewUpload:(id)sender {
- (IBAction)onOverlayViewError:(id)sender {
NSURLSessionDataTask *task = [self.sessionManager GET:@"/status/418"
parameters:nil
progress:nil
success:nil
failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Task %@ failed, as expected, with error: %@", task, error);
Expand Down

0 comments on commit e8df27b

Please sign in to comment.