title: how to run activity indicator until download image ?
body: <p>before image download , i want to start activty indicator. </p>
  
  <p>here is my image download function that using url </p>
  
  <pre><code>extension UIImageView {
  
  func downloadImage(from url : String){
  
      let urlRequest = URLRequest(url: URL(string: url)!)
      let task = URLSession.shared.dataTask(with: urlRequest){(data,response,error)in
  
          if error != nil {
  
              print("error...")
  
          }
  
          DispatchQueue.main.async {
              self.image = UIImage(data:data!)
          }
      }
  
      task.resume()
  }
  </code></pre>
  
  <p>My question is how can i do this ? ( sorry my bad english ) </p>