Yes, iOS 10.3 finally gives developers the ability to programmatically change the icon of their applications.
You can change the appIcon from iOS 10.3. To do this, you need to set supportsAlternateIconin Yesin info.plist.
Both primary and secondary icons must be added CFBundleIconsto your application info.plist.
//Info.plist
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>Icon1</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>alternater1</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
<key>Icon2</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>alternater2</string>
</array>
</dict>
</dict>
</dict>
, UIApplication :
C:
[[UIApplication sharedApplication] setAlternateIconName:@"alternater2" completionHandler:^(NSError * _Nullable error) {
NSLog(@"Error...");
}];
Swift 3:
if UIApplication.shared.supportsAlternateIcons{
UIApplication.shared.setAlternateIconName("alternater2", completionHandler: { (error) in
print(error ?? "")
})
}
.
Apple Document: setAlternateIconName (_: completeHandler:)
setAlternateIconName()