title: Move Closure from ViewController to ViewModel
body: <p>The following snipped code is located in my <code>SettingViewController</code> and want to move <code>LocationManager.locationUpdated</code> closure logic into <code>SettingsViewModel</code>. I am stuck how to manage it.</p>
  <p><strong>SettingsViewController.swift</strong></p>
  <pre><code>private let settingsViewModel : SettingsViewModel()
  
  func updateLocationButtonClicked() {
   if isLocationUpdateNeeded() {
         CustomLocationManager.locationUpdated { success in
           if success {
             self.updateMap()
           } else {
             DispatchQueue.main.async {
               // add an alertview here
             }
           }
         }
       } else {
          updateMap()
       }
   }
  </code></pre>