title: Why don't loading indicator show when user save image to library in Swift?
body: <p>I want to build the feature which let user can save the image to their library. The problem is that it takes a long time to process, so i want to show the loading indicator to let user wait in moment. But the loading does not show. How can i fix my problem? Thank for your helping. My code is below:</p>
  
  <pre><code>@objc func saveImage(sender: UIButton) {
      DispatchQueue.main.async {
          showLoading(viewCtrl: self)
          let imageString = self.arrayPost[sender.tag].image
          if let url = URL(string: imageString),
              let data = try? Data(contentsOf: url),
              let image = UIImage(data: data) {
              UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
              showSuccess(viewCtrl: self)
          }
      }
  }
  </code></pre>