:scream: Change your iOS application's icon programmatically since iOS 10.3
Since iOS 10.3, it is possible to change the application's icon programmatically. This repository contains simple application demo it.
/Project
directory.pod install
.AlternativeIconExample.xcworkspace
with Xcode.Import your alternative icon files to project file.
.xcassets
.Open your project's Info.plist
file.
key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>{alternate-icon-key}</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>{alternate-icon-file-name}</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>{primary-icon-file-name}</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
Write some code to set alternative icon.
IApplication.shared.setAlternateIconName("alternative-icon-key") { error in
// Handle error or do something.
AlternativeIcon-Example is available under the MIT license. See the LICENSE file for more info.