![]() Return #imageLiteral(resourceName: #imageLiteral(resourceName. ![]() ![]() For more information on why the file name is nil you can check the alternateIconName description on Apple documentation. That’s why the file name for it will be nil. In our enum, classic is the default app icon. Now let’s add the file name of each of our icon in the enum, and a preview icon that will be displayed in our App UI. First, create an enum containing each of your alternate App Icons. To handle icon changes easily, we will create an Icon Manager to interact with Apple APIs. If alternateIconName is nil then the default App Icon will be used.įinally, alternateIconName returns the name of the alternate icon currently used, or nil if the default icon is used. The setAlternateIconName method is used to change the App Icon to its primary icon or to one of its alternate icons. The Apple API to switch App Icons is quite simple and consists of 3 var/functions: var supportsAlternateIcons: Bool Īs per the Apple Documentation, supportsAlternateIcons will be true when the system allows you to change the icon of then App, or false otherwise. Once you’ve added all your icons in ist, your alternate icons are ready to be used in your App. The name of the entry is the name of the icon which will be used later in your Xcode project, and the string value of the item is the name of the icon file that you added in the project at Step 1. ![]() Note that the alternate icons files must to be in the Project directory, not in the Assets directory.Īpp your app icons file in the project directory Step 2: Register your new Icons in the ist fileįirst, add a new CFBundleIcons entry (Icon files (iOS 5)), then add another entry CFBundleAlternateIcons.ĬFBundleAlternateIcons entry in istįor each alternate icon, add a new entry in the ist file, under CFBundleAlternateIcons. 120px (60px 180px (60px the icons to your project under a new directory App Icons.Step 1: Design your App Iconsĭesign your alternative App Icons and export them in two sizes: Here are the 4 steps to add this cool feature to your App. Apple introduced in iOS 10.3, a new feature that make possible for developers to offer App Icon customization to their users with predefined additional icons. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |