2020-02-14-Swift-PerformTaskInBackground

func someFunctionhere() {
    // perform something on background thread
  DispatchQueue.global(qos: .background).async {
    // perform background tasks here


    // Now switch back to Main Thread for UI Operations
    DispatchQueue.main.async {
        // Update UI here
      MBProgressHUD.hide(for: hudView, animated: false)
    }
  }
}

Last updated

Was this helpful?