title: how to return array using closure
body: <p>I am new on Swift and I am trying to use closure for getting results back from viewcontroller</p>
  
  <p>Here is the example</p>
  
  <pre><code>class MD5Calculator {
  
      static func imageChecksum(imageArray: [UIImage], onCalculated: @escaping () -&gt; [String]){
  
          DispatchQueue.global(qos: .userInitiated).async {
  
              var array: [String] = []
  
              for chosenImage in imageArray {
                  if let jpegData = UIImageJPEGRepresentation(chosenImage, 80) {
                      let checksum = jpegData.md5()
                      let chsum = checksum.toHexString()
                      array.append(chsum)
                  }
              }
  
              DispatchQueue.main.async {
                  //return array
              }
          }
  
      }
  }
  </code></pre>
  
  <p>I want md5 calculation do in background and when its done pass it to viewController.</p>
  
  <p>I created closure but I don't know how to return it. 
  my question is:</p>
  
  <ol>
  <li><p>How to pass string array with closure</p></li>
  <li><p>How to call ImageChecksum in view controller</p></li>
  </ol>