Skip to content

QueenieCplusplus/iOS_Back_6

Repository files navigation

iOS_Back_6

Async Downloader in Background using URLSessionDownloadTask.

  1. setup in Info Property List, however this setup value effects the apps approval before the release phase.

  2. code

     let url = URL(string: "https://www.windy.com/25.038/121.564?24.467,121.564,8,m:emSajxL")
     
     let config = URLSessionConfiguration.default
     let session = URLSession(configuration: config)
     
     //let downloader = session.downloadTask(with: <#T##URLRequest#>, completionHandler: <#T##(URL?, URLResponse?, Error?) -> Void#>)
     
     let dl = session.downloadTask(with: url!
    
  3. output

  1. ref

    https://zh-tw.coderbridge.com/series/01d31194cb3c428d9ca2575c91e8b997/posts/c44ba1db0ded4d53aec73a8e589ca1e5

  2. allow Download Task running in Background.

    https://github.com/QueenieCplusplus/iOS_Back_16