Skip to content

Instantly share code, notes, and snippets.

@andresr-dev
Created April 28, 2022 17:09
Show Gist options
  • Select an option

  • Save andresr-dev/cfa298dba04f6f6afffd69963b544fca to your computer and use it in GitHub Desktop.

Select an option

Save andresr-dev/cfa298dba04f6f6afffd69963b544fca to your computer and use it in GitHub Desktop.
This is how you can open settings from your application.
func openSettings() {
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl) { success in
print("Settings opened: \(success)")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment