From 346799dc8b29f52cd1ff88e825388126d65a9434 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Tue, 24 Apr 2012 21:28:06 -0700 Subject: [PATCH] Adding documentation for pause/resume --- AFNetworking/AFURLConnectionOperation.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AFNetworking/AFURLConnectionOperation.h b/AFNetworking/AFURLConnectionOperation.h index f04f474..0266ced 100644 --- a/AFNetworking/AFURLConnectionOperation.h +++ b/AFNetworking/AFURLConnectionOperation.h @@ -156,9 +156,25 @@ extern NSString * const AFNetworkingOperationDidFinishNotification; /// @name Pausing / Resuming Requests ///---------------------------------- +/** + Pauses the execution of the request operation. + + @discussion A paused operation returns `NO` for `-isReady`, `-isExecuting`, and `-isFinished`. As such, it will remain in an `NSOperationQueue` until it is either cancelled or resumed. Pausing a finished or cancelled operation has no effect. + */ - (void)pause; + +/** + Whether the request operation is currently paused. + + @return `YES` if the operation is currently paused, otherwise `NO`. + */ - (BOOL)isPaused; +/** + Resumes the execution of the paused request operation. + + @discussion Pause/Resume behavior varies depending on the underlying implementation for the operation class. In its base implementation, resuming a paused requests restarts the original request. However, since HTTP defines a specification for how to request a specific content range, `AFHTTPRequestOperation` will resume downloading the request from where it left off, instead of restarting the original request. + */ - (void)resume; ///----------------------------------------------