Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pedrommcarrasco/dabebe009c6738a6cb6c0ae774a6ef13 to your computer and use it in GitHub Desktop.
Save pedrommcarrasco/dabebe009c6738a6cb6c0ae774a6ef13 to your computer and use it in GitHub Desktop.
How To Have Multiple Icons (Change Icon)
// To set the light icon
UIApplication.shared.setAlternateIconName("light") {
guard let error = $0 else { return }
os_log("Error setting alternative icon: %@", error.localizedDescription)
}
// To set the light icon
UIApplication.shared.setAlternateIconName("dark") {
guard let error = $0 else { return }
os_log("Error setting alternative icon: %@", error.localizedDescription)
}
// To go back to the default icon
UIApplication.shared.setAlternateIconName(nil) {
guard let error = $0 else { return }
os_log("Error setting the default icon: %@", error.localizedDescription)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment