Skip to content

Instantly share code, notes, and snippets.

@troys-code
Created December 29, 2018 13:50
Show Gist options
  • Select an option

  • Save troys-code/704b9229a46d6dc3380457171205ff8a to your computer and use it in GitHub Desktop.

Select an option

Save troys-code/704b9229a46d6dc3380457171205ff8a to your computer and use it in GitHub Desktop.
// so user can allow app to use location
func openMyAppLocationSettings() {
if let bundleId = Bundle.main.bundleIdentifier,
let url = URL(string: "\(UIApplication.openSettingsURLString)&path=LOCATION/\(bundleId)")
{
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
// so user can enable location services
func openLocationSettings() {
if let url = URL(string: "\(UIApplication.openSettingsURLString)&path=LOCATION") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment