Contents

setDestination(_:allowOverwrite:)

Sets the destination path of the downloaded file.

Declaration

func setDestination(_ path: String, allowOverwrite: Bool)

Parameters

  • path:

    The path for the downloaded file.

  • allowOverwrite:

    True if an existing file at path can be replaced, False otherwise.

Discussion

If allowOverwrite is false and a file already exists at path, a unique filename will be created for the downloaded file by appending a number to the filename. The delegate can implement the download(_:didCreateDestination:) delegate method to determine the filename used when the file is written to disk.

Special Considerations

An NSURLDownload instance ignores multiple calls to this method.

See Also

Related Documentation

Creating and configuring a download instance