I have the info on how to set up alternate icons in iOS 10.3 adding the key in the Info.plist. However, what I am not sure of is which sizes are needed for each alternate. I use assets folders right now, and have to put in about 12 different sized icons for spotlight, different iphone and ipad sizes, etc. What's the rule on the alternate ones?
This is not a duplicate of is it possible. It is asking if you have to include every single size for the alternate icons
To change the icon you need to use
setAlternateIconName(_:completionHandler:)
You need to put the
CFBundleAlternateIcons
inInfo.plist
. The Alternate icon sizes are same as of primary icon sizes listed here.You can read full docs in Contents of the CFBundleAlternateIcons Dictionary Entry
Edit: This excerpt is from the above docs
icon sizes listed here
Since the biggest problem is how to configure the icon image source and info.plist, here is a sample to tell you how to set alternate icons in iOS 10.3, implemented in Swift 3.
If your app doesn't support iPad, the icon image source can be 60pt@2x and 60pt@3x (120x120 180x180), and the 20pt 29pt and 40pt all can be generated from the 60pt image. So, your alternate icon image source should also be 60pt@2x and 60pt@3x, if it is a iPhone-only app. And it should be 83.5pt, if your app supports iPad Pro.
Like what you saw in the picture, the alternate icon image should be added to the project as a png file (the blackBgColor image in my sample), but not added to Assets.xcassets.
The configuration for alternate icons in info.plist is kinda complicated, so if this is your first time doing this, I suggest you copy my code in plist. And, notice my alternate icon's name (blackBgColor) has beed used TWICE in plist, if you are gonna change the icon's name based on my version, make sure you changed the name in both of the two places.
Now, code in ViewController will be simple.