DownloadStep
@available(iOS 14.5, macOS 11.3, *)
public class DownloadStep : NSObject, Step
extension DownloadStep: WKDownloadDelegate
Step that downloads a file from a given URL and returns the contents
The StepFlowResult
returned by the handler
can be used to drive control flow of the steps.
-
Initializer.
Declaration
Swift
public init( url: URL, handler: @escaping ScriptStepHandler )
Parameters
url
URL to download from
handler
Callback function which returns the downloaded data, and passes the model JSON dictionary for modification.
-
Declaration
Swift
public func run(with browser: Browser, model: JSON, completion: @escaping StepCompletionCallback)
-
Undocumented
Declaration
Swift
public func download(_: WKDownload, decideDestinationUsing _: URLResponse, suggestedFilename: String, completionHandler: @escaping (URL?) -> Void)
-
Undocumented
Declaration
Swift
public func downloadDidFinish(_: WKDownload)
-
Undocumented
Declaration
Swift
public func download(_: WKDownload, didFailWithError error: Error, resumeData _: Data?)