5

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:

enter image description here

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

vikzilla
  • 3,998
  • 6
  • 36
  • 57

2 Answers2

2

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.

vikzilla
  • 3,998
  • 6
  • 36
  • 57
0

If this will not help, disable app icons assets. It helps me. I guess there is some conflict between assets and plist icons.