Skip to content

Instantly share code, notes, and snippets.

@weardo98
weardo98 / gist:600c55b388148fa7a255
Created July 10, 2014 04:38 — forked from rileytestut/gist:6245198
RSTWebViewControllerDownloadDelegate Protocol
@protocol RSTWebViewControllerDownloadDelegate <NSObject>
@optional
// Return YES to tell RSTWebViewController to create a [Redacted] object and start a [Redacted]DownloadTask.
// Or, if you choose to, you can return NO, and then implement your own downloading logic via [Redacted] with the NSURLRequest
- (BOOL)webViewController:(RSTWebViewController *)webViewController shouldStartDownloadWithRequest:(NSURLRequest *)request;
// If implemented, you must call startDownloadBlock, or else the download will never start. This was you can display an alert to the user asking if they want to download the file.
// If needed, you can keep a reference to the [Redacted]DownloadTask to suspend/cancel during the download. You can access the original request via downloadTask.originalRequest, or the current one via downloadTask.currentRequest