downloadTaskWithURL method

NSURLSessionDownloadTask downloadTaskWithURL(
  1. NSURL url, {
  2. required ObjCBlock<Void Function(NSURL?, NSURLResponse?, NSError?)> completionHandler,
})

downloadTaskWithURL:completionHandler:

Implementation

NSURLSessionDownloadTask downloadTaskWithURL(
  objc.NSURL url, {
  required objc.ObjCBlock<
    ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)
  >
  completionHandler,
}) {
  objc.checkOsVersionInternal(
    'NSURLSession.downloadTaskWithURL:completionHandler:',
    iOS: (false, (7, 0, 0)),
    macOS: (false, (10, 9, 0)),
  );
  final _ret = _objc_msgSend_r0bo0s(
    this.ref.pointer,
    _sel_downloadTaskWithURL_completionHandler_,
    url.ref.pointer,
    completionHandler.ref.pointer,
  );
  return NSURLSessionDownloadTask.castFromPointer(
    _ret,
    retain: true,
    release: true,
  );
}