How to customize your app icon?

Overview

iOS 10.3 allows you to change your app icon programmatically. We can change our app icon programmatically.

Let’s get started.

Tool Used: Xcode 9.1, Swift 4+

Step 1: Setup Project

Create new Xcode project.

Write name of your project, we have use SwitchingAppIcon. (Make sure that you choose swift language) and Click on Next button.

Create two icons @2x and @3x for the iPhone, we named it as appicon_1@2x and appicon_1@3x. Add them in their appropriate places in the assets folder.

We can add alternative icons but not into the assets folder.

Step 2: Register Alternative icons

Register these alternative icons in our Info.plist. Add this to your Info.plist file.

For iPhone App

Make sure alternative icons are named without @2x and @3x prefix.

For iPad App

Step 3: Write some code

Create 3 buttons in our storyboard which will change between our icons.

Connect them in your ViewController and add this code to change app icons

Step 4: Test

Press on App icon 1 to set default App icon.

Press home button to see result.

Press on App icon 2 to set appicon_2 icon

Press home button to see result.

Press on App icon 3 to set appicon_2 icon

Press home button to see result.

Note:
Be careful to use a unique key name for each alternate icon

For more reference
Apple Developer Documentation

mm

Sandeep Joshi iOS Team Lead

I’m Sandeep Joshi - an iOS developer at Yudiz Solutions Pvt. Ltd. - a leading iPhone App Development company. I am ambitious and intensely interested in what I do. You'll quickly find that I do not merely develop software - I develop highly maintainable, elegant code that will save you enormous sums in the long run.

Comments are closed.

Top