title: How to open Location Services page in iOS using swift?
body: <p>I need to ask user to enable Location Services if disabled. I have created an Alert which asks user if he wants to enable Location. I user clicks Ok I want to open Location Services page on iPhone as seen below:</p>
  <p><a href="https://i.stack.imgur.com/WZVDW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WZVDW.jpg" alt="enter image description here" /></a></p>
  <p>I am trying 'openSettingsURLString' but it opens App settings instead of Location Services page, this is the code:</p>
  <pre><code>            let url = URL(string: UIApplication.openSettingsURLString)
  
              let settingsAction = UIAlertAction(title: NSLocalizedString(&quot;OK&quot;, comment: &quot;&quot;), style: .default) {
                  (UIAlertAction) in UIApplication.shared.open(url!, options: [:], completionHandler: nil)
                  self.dismiss(animated: true, completion: nil)
              }
  
              alertController.addAction(cancelAction)
              alertController.addAction(settingsAction)
              self.present(alertController, animated: true, completion: nil)
  </code></pre>