I am unable to change the app's icon to an alternate icon in iOS 11 (Xcode 9, beta 3).
However, it works fine in iOS 10.3 (with the following code):
if #available(iOS 10.3, *) {
guard let iconName = MySingletonClass.sharedInstance.iconName() else { return }
delay(0.01) {
UIApplication.shared.setAlternateIconName(iconName, completionHandler: { (error) in
if let error = error {
print(error.localizedDescription)
} else {
print("Success!")
}
})
}
} else {
// Fallback on earlier versions
}
My plist is set-up like so:
I find it odd because I have used other apps that use alternate app icons in iOS 11. Is there a known bug with this in iOS 11?
Note: If you're wondering why I'm using the delay, see this post
I solved this by implementing it in a ViewController, rather than the AppDelegate's appDidFinishLaunchingWithOptions
Still need to run it within a delay for it to work though, as related questions / answers point out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With