Created
June 29, 2019 23:28
-
-
Save pedrommcarrasco/dabebe009c6738a6cb6c0ae774a6ef13 to your computer and use it in GitHub Desktop.
How To Have Multiple Icons (Change Icon)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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