iPhone - Change icon of the app programmatically at runtime

2.7k views Asked by At

I can read that changing the app icon programmatically at runtime is not possible, at least since iOS 3.0.

But... I regulary can see on "App" websites apps that can put icons on the springboard. The first I remember is that kind of app that you give a friend's picture from your album, and it creates an icon so you can call him just clicking on that icon:

http://itunes.apple.com/fr/app/speedtouch-the-best-home-screen/id378360978?mt=8
http://itunes.apple.com/fr/app/desktop-shortcut/id421701004?mt=8
http://itunes.apple.com/fr/app/appbutler-app-organizer/id327391626?mt=8
http://itunes.apple.com/fr/app/tap4music/id365578914?mt=8

So I guess, is it still impossible to change the app icon programmatically at runtime?

3

There are 3 answers

2
Ell Neal On BEST ANSWER

Update

Apple have changed this, you can do this now: https://developer.apple.com/documentation/uikit/uiapplication/2806818-setalternateiconname

Original Answer

What you're thinking of here are WebClips, which are basically shortcuts to websites on the home screen. An actual application cannot change it's icon at runtime, as it's defined in the static Info.plist file.

The only exception to this rule is Newsstand applications.

1
Conrad Shultz On

Changing your actual icon (other than, e.g, badging) would require changing the app bundle. I'm pretty sure that you don't have write access to the bundle, and in any event this should change the code signature, causing the OS to prevent launching.

So, no. Apps can put links to web sites, but not change their own app.

0
Andrew Ebling On

This is now possible in iOS 10.3 using the UIApplication.setAlternateIconName(_:completionHandler:) API.

See my answer to this question: https://stackoverflow.com/a/44966454/233602