Skip to content

Instantly share code, notes, and snippets.

View alessiorubicini's full-sized avatar

Alessio Rubicini alessiorubicini

View GitHub Profile
@alessiorubicini
alessiorubicini / ChangeAppIcon.swift
Created April 1, 2025 14:14
Function to dinamically change app's icon on iOS and iPadOS devices that support alternate icons.
import UIKit
/// Changes the app's alternate icon.
/// - Parameter iconName: The name of the alternate icon. Pass `nil` to reset to the default icon.
func setAlternateIcon(_ iconName: String?) {
guard UIApplication.shared.supportsAlternateIcons else {
print("Alternate app icons are not supported on this device.")
return
}