{"action":"opened","issue":{"url":"https://api.github.com/repos/rs/SDWebImage/issues/1034","labels_url":"https://api.github.com/repos/rs/SDWebImage/issues/1034/labels{/name}","comments_url":"https://api.github.com/repos/rs/SDWebImage/issues/1034/comments","events_url":"https://api.github.com/repos/rs/SDWebImage/issues/1034/events","html_url":"https://github.com/rs/SDWebImage/issues/1034","id":56949886,"number":1034,"title":"sd_setImageWithURL's completedBlock not called if operation was cancelled","user":{"login":"timkoma","id":4168601,"avatar_url":"https://avatars.githubusercontent.com/u/4168601?v=3","gravatar_id":"","url":"https://api.github.com/users/timkoma","html_url":"https://github.com/timkoma","followers_url":"https://api.github.com/users/timkoma/followers","following_url":"https://api.github.com/users/timkoma/following{/other_user}","gists_url":"https://api.github.com/users/timkoma/gists{/gist_id}","starred_url":"https://api.github.com/users/timkoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timkoma/subscriptions","organizations_url":"https://api.github.com/users/timkoma/orgs","repos_url":"https://api.github.com/users/timkoma/repos","events_url":"https://api.github.com/users/timkoma/events{/privacy}","received_events_url":"https://api.github.com/users/timkoma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-08T12:29:03Z","updated_at":"2015-02-08T12:29:03Z","closed_at":null,"body":"I think that it should be called with error code 'cancelled'.\r\nFor example: How I should write safe code with activity indicator during image loading operation, if I'm not sure that completed callback will be always called ?\r\n\r\n            [_activityIndicator setHidden:NO];\r\n            [_activityIndicator startAnimating];\r\n            // load image\r\n            __weak UIActivityIndicatorView* weakActivityIndicator = _activityIndicator;\r\n            [_imageView sd_setImageWithURL:newUrl placeholderImage:nil options:SDWebImageProgressiveDownload|SDWebImageHighPriority\r\n                progress:nil\r\n                completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {\r\n                    [weakActivityIndicator stopAnimating];\r\n                    [weakActivityIndicator setHidden:YES];\r\n                }];\r\n"}}