My script uses ImageMagick (version 7.1.0-57) to resize the given main image and output seven specifically sized images. If you want more information about Apple's app icons you can check out their developer or their designer documentation. This large number of required images is exactly why resizing my main app icon was so cumbersome and needed a script made. Each one of these shown squares will need an image, of the specified size, dragged onto it for import. Changing these selections affect the sizes shown in the main window. On the right property menu I can change each drop down to specify which sizes I want to include in my app. Not shown are all the other sizes for the other devices if I scroll down in the center window. There's so many because on the right side I've selected All Sizes. Your view, if you follow along, may look something like this: Here you can see all the app icons listed for iOS. Anyway, once I clicked on AppIcon the main view is opened showing where I can set each individual icon that the application needs for it's app icon. As a quick aside here is where you add any other assets you want to include in your app like branding colors or images. Once I click on Assets XCode will open an inner menu on the left, directly to the right of the current list I was on, showing AccentColor and AppIcon. In XCode, running Version 14.1, I can access the app icon by going to the Project Navigator, on the left sidebar, and looking for the Assets file. I realized this process needed to be automated and thus created a Bash script to speed it up. This took awhile and became especially onerous when I needed to make a minor change to the image thus requiring me to go through the entire process again to update all of the image versions. The first couple times I did this manually by opening my image in Apple Preview and repeatedly resizing and exporting it for each required size. In the process I quickly realized just how many differently sized images XCode needs when setting a simple app icon. I'm currently developing Apple applications using XCode. TLDR:In case you want to skip directly to the code itself you can find it embedded near the bottom of this post or through the GitHub Gist here. In case you're having a similar issue I had to share my script which made my process so much simpler and may help you too. And maybe we need a better UI for all this in the IDE, but we can start with docs so devs can make better decisions about their images.While developing iPhone apps I realized the apps themselves look so much better with a custom app icon which led to me realizing just how cumbersome resizing an image multiple times can be. Maybe we need an image section in the docs that just talk about how to do sizing correctly. This is not just for tabs, but also menus, toolbars, and other icons. And even though Android and Windows look correct, they are in fact loading a huge image and resizing it after the fact. For example, Apple has different recommendations if the image is square, round, portrait or landscape. We can have things about that you need to make sure that the images you are loading are the correct size for the use case and links to the docs that describe sizes and styles. We have a tiny bit of comment here: maybe the docs need to be more explicit? For example, on the tab bar section we should have a section the talks about performance and best practices?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |