title: When accessing the settings to enable access to a feature of device, why should I use
body: <p>I'm slightly confused as to which way is best to access the settings to enable a device feature if access has been denied before. I have seen two ways which one seems to be using threading. But I haven't found a clear explanation as to why? Would appreciate any insight on this. Thanks.</p>
  
  <p>Both works , either the snippet below as an action of an alert controller: </p>
  
  <pre><code>alert.addAction(UIAlertAction(title: "Settings", style: .default, handler: {(_ action: UIAlertAction) -&gt; Void in
              //open settings to allow access to geo
              guard let stngUrl = URL(string: UIApplicationOpenSettingsURLString) else {
                  return
              }
              if UIApplication.shared.canOpenURL(stngUrl) {
                  if #available(iOS 10.0, *) {
                      UIApplication.shared.open(stngUrl, completionHandler: { (success) in
                      })
                  } else {
                      if UIApplication.shared.canOpenURL(stngUrl) {
                          UIApplication.shared.openURL(stngUrl)
                      }
                  }
              }                
          }))
          present(alert, animated: true, completion: nil)
  </code></pre>
  
  <p>or using DispatchQueue like snippet below? </p>
  
  <pre><code> alert.addAction(UIAlertAction(title: "Settings", style: .default, handler: {(_ action: UIAlertAction) -&gt; Void in            
          DispatchQueue.main.async(execute: {() -&gt; Void in
              UIApplication.shared.openURL(URL(string: UIApplicationOpenSettingsURLString)!)
          })
      }))
      present(alert, animated: true, completion: nil)
  </code></pre>