Launcher Icon Generator. Generate Web Icon. See the source on GitHub. All generated art is licensed under a Creative Commons Attribution 3.0 Unported License. App Icon Generator, Generate your app icons in milliseconds for iOS, watchOS and macOS with just a drag, a drop and a click! Drag your app icon image into the drop zone. Choose the devices that you would like to export for.
- Android App Icon Generator
- App Icon Generator 1 2 1 2
- App Icon Generator 1 2 1 1 Press Break
- 1/2 Fraction
- App Icons are the images you press on your smartphone to launch an application. As newer phones are released with higher resolution screens, higher resolution app icons are needed. Developers still want to maintain support for the older phones with lower resoltion so when you create an app icon you need to create several size variations of the.
- AppIconMaker gives you the option of registering with us. This gives you the opportunity to have an account with us and have all your app icons secured in the cloud.
Swift version: 5.2
Paul Hudson@twostraws
iOS 10.3 finally gave developers the ability to change their app’s icon programmatically, although it takes a little work to set up. It also isn’t quite as powerful as you might hope – you can’t recreate the moving hands of the Clock app, for example.
![App Icon Generator 1 2 1 App Icon Generator 1 2 1](https://techcrunch.com/wp-content/uploads/2018/01/giphy1.gif)
The actual code to change your app’s icon is trivial, but first there’s some setup work because you must declare all possible icons in your Info.plist file. The process behind this is far from optimal, and right now the best thing to do is edit your Info.plist as XML rather than trying to use the built-in property list editor in Xcode.
To get started, we need some icons. These should be placed loose in your project or in a group, rather than inside an asset catalogue. Remember to use the @2x and @3x naming convention to ensure iOS automatically picks the correct icon for users’ devices.
For this example, we’re using these example icon files:
- [email protected], [email protected]
- [email protected], [email protected]
- [email protected], [email protected]
They are all just regular PNGs, with the @2x being 120x120 and the @3x being 180x180.
Now go to your project navigator, right-click your Info.plist file, and choose Open As > Source Code. This will reveal the raw XML behind your plist – it might seem like a lot at first, but trust me this is way better than using the GUI for this particular task.
Defining the icons for your app is done with a very specific set of property list keys and values:
CFBundleIcons
is a dictionary that defines what your primary icon is (CFBundlePrimaryIcon
) and what your alternate icons are (CFBundleAlternateIcons
)- The primary icon key itself is a dictionary that lists its icon files (
CFBundleIconFiles
), which is an array containing the filenames for your primary icon, and whether iOS should apply gloss effects to it (UIPrerenderedIcon
). Yes, that latter setting has been dead since iOS 7 but it still loiters around. - The alternate icons key is also a dictionary, but this time the keys of its children are the names of images you want to use. This doesn’t need to be their filename, just however you want to reference each icon in your code.
- Each icon name is another dictionary, which contains the same two keys as
CFBundlePrimaryIcon
: theCFBundleIconFiles
array and theUIPrerenderedIcon
boolean.
To be quite clear,
CFBundleIcons
is a dictionary containing the key CFBundleAlternateIcons
, which is a dictionary containing the key YourImageName
, which is another dictionary containing the icon files and gloss effect settings.If your head is spinning a little, that’s OK: it really is far too complex and I’m amazed this is new API. However, it’s what we have so if you want to start using it today then you’re going to want some example XML to get you started.
At the end of your property list XML you should see this:
Before that – i.e., directly before
</dict>
, add this:Again, I’ve used the files [email protected], [email protected], [email protected], [email protected], [email protected], and [email protected] for that – you’ll need to replace those filenames with your own.
Collections 4 2 – organize your desktop icons shortcut. Do not put the @2x or @3x parts into your plist, and don’t add the .png either.
In that example XML above I used the icon names “AppIcon-2” and “AppIcon-3”. Remember, these aren’t the filenames, they are just the reference names you want to use in your code.
Now that you have your property list configured the rest is easy: all the hard work is done by the method
setAlternateIconName()
, which takes an icon name to change to or nil to use the app’s default icon.Iobit macbooster 8 0 1. For example, you might want to add a button that changes your app icon to AppIcon-2, in which case you would use this:
To reset your icon to the primary icon, you would use this:
If you want, you can optionally provide a completion handler to be run when the call finishes. This gets passed an
Error?
parameter that will be set to a value if something went wrong, so if you wanted to make your code more robust you might use something like this:![Generator Generator](https://cnet1.cbsistatic.com/img/1Kd2eVJ5aMOT50sKJZSbx6EH944=/fit-in/570x0/2013/10/27/b1a25811-c90a-11e3-bddd-d4ae52e62bcc/QRcodes.jpg)
That’s all you need to get started, but it’s important to mention two more things just briefly.
First, you can check whether your app is able to switch to an alternate icon by checking the
supportsAlternateIcons
property on your application, like this:You can also query which alternate icon is currently showing by reading the
alternateIconName
property. This is a String?
: it will be nil
if your primary icon is showing, or an icon name if an alternate icon is showing:Android App Icon Generator
One last thing:
setAlternateIconName()
looks for the icon files in your app’s resource folder rather than any arbitrary location, which means you can’t generate icons dynamically.SPONSORED Ever ask for help and your reviewer immediately notices issues you missed? Fernando Olivares is a 10-year veteran from Big Nerd Ranch and Lambda School who can help hone your app building skills, and he's just launched a new book that does just that – use the code 'hacking' to save $5!
Charles proxy android. Available from iOS 10.3
App Icon Generator 1 2 1 2
Similar solutions…
App Icon Generator 1 2 1 1 Press Break
About the Swift Knowledge Base
1/2 Fraction
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.