A lost night in Launch Images

I used to take Apple Developer documentations as a holy book, they had everything, all the details needed to do anything, you just had to have the links in mind and look for them in the right place, but all in one great reference list.
I decided to a long forgotten app in iOS AppStore called “Tehran Traffic”. not really a complex app, just a UIWebView with some custom configs to show a web app I made that retrieve, reformat and show the images of Tehran’s traffic flow from some resources.

I finished the coding over the weekend, mostly on the freeform interface builder, remembering how Objective-C (xcode 6) worked (delegation man…) and the testing with all kind of devices and simulators. I was aiming for an app as universal as possible, from iOS 6.0 to 8.1 and all the iDevices, iPhone4/4s, iPhone 5/5s, iPhone 6/6Plus, All the iPads and mini iPads. The interface builder freeform wasn’t as bad at first I thought it is.

I asked a friend of mine to design the icons and received the icons tonight at around 11 pm, so I started working on adding them and uploading the binary, I thought it’s going to be a max 30 minutes task, wishful thinking Eh?

Alright the problem starts here, the Apple iOS Human Interface Guide is updated and includes only things related to iOS 8 and iPhone 6 and 6 Plus.
Blah Blah

I’m gonna change the format of this blog and just included the information that might come in handy for anyone searching for the reason of these errors and the solution (mostly for my future reference šŸ™‚ )

NOTE: all the images, icons and launch images must be in PNG format.

The errors and warnings:

Screen Shot 2014-11-20 at 3.48.28 AM

Applications using Launch Screen Files and targetting iOS 7.1 and earlier need to also include a Launch Image in an Asset Catalog.


 

iTunes Store operation failed.
Your binary is not optimized for iPhone 5 – New iPhone apps and app updates submitted must support the 4-inch display on iPhone 5 and must include a launch image with the -568h size modifier immediately following the <basename> portion of the launch image’s filename. Launch images must be PNG files and located at the top-level of your bundle, or provided within each .Iproj folder if your localize your launch images.Ā and here is a link to apple documentation that does not exist anymore… lol

 

Solution: For this I stopped using the traditional way of having named launch images and use the Asset Catalog (Images.xcassets) instead.

Screen Shot 2014-11-20 at 3.37.44 AM

These chart would be a great help to see what size of launch images you need for each part:

Table 39-1Size (in pixels) of custom icons and images

Asset

iPhone 6 Plus (@3x)

iPhone 6 and iPhone 5 (@2x)

iPhone 4s (@2x)

iPad and iPad mini (@2x)

iPad 2 and iPad mini (@1x)

App icon (required for all apps)

180 x 180

120 x 120

120 x 120

152 x 152

76 x 76

App icon for the App Store (required for all apps)

1024 x 1024

1024 x 1024

1024 x 1024

1024 x 1024

1024 x 1024

Launch file or image (required for all apps)

Use a launch file (seeLaunch Images)

For iPhone 6, use a launch file (see Launch Images)

For iPhone 5, 640 x 1136

640 x 960

1536 x 2048 (portrait)

2048 x 1536 (landscape)

768 x 1024 (portrait)

1024 x 768 (landscape)

Spotlight search results icon (recommended)

120 x 120

80 x 80

80 x 80

80 x 80

40 x 40

Settings icon (recommended)

87 x 87

58 x 58

58 x 58

58 x 58

29 x 29

Toolbar and navigation bar icon (optional)

About 66 x 66

About 44 x 44

About 44 x 44

About 44 x 44

About 22 x 22

Tab bar icon (optional)

About 75 x 75 (maximum: 144 x 96)

About 50 x 50 (maximum: 96 x 64)

About 50 x 50 (maximum: 96 x 64)

About 50 x 50 (maximum: 96 x 64)

About 25 x 25 (maximum: 48 x 32)

Default Newsstand cover icon for the App Store (required for Newsstand apps)

At least 1024 pixels on the longest edge

At least 1024 pixels on the longest edge

At least 1024 pixels on the longest edge

At least 1024 pixels on the longest edge

At least 512 pixels on the longest edge

Web clip icon (recommended for web apps and websites)

180 x 180

120 x 120

120 x 120

152 x 152

76 x 76

(Table from the older and betterĀ iOS HIG)

Also there is another option in the Images.xcassetsĀ labeled “iPad Portrait Without Status Bar iOS 5,6” (and another for Landscape):

Here are the accepted sized for these:

iPad – Portrait iPad – Landscape
Non-retina 768 x 1004 pixels
Default-Portrait.png
1024 x 748 pixels
Default-Landscape.png
Retina 1536 x 2008 pixels
Default-Portrait@2x.png
2048 x 1496 pixels
Default-Landscape@2x.png

(Thanks toĀ idev101Ā for the table)

For iPhone 6 and 6 Plus if you don’t want to use the LaunchScreen.xib, you can use these image sizes:

For iPhone 6:

  • 750 x 1334 (@2x) for portrait
  • 1334 x 750 (@2x) for landscape

For iPhone 6 Plus:

  • 1242 x 2208 (@3x) for portrait
  • 2208 x 1242 (@3x) for landscape

 

Now for the icons I used to use the named icon names for all the different devices and places (e.g spotlight, setting, …). but the same issue, even though I got all the required sizes I encountered errors:

Used to have these filenames:Ā Icon-76.png Icon-Small-50@2x.pngĀ 512×512.png Icon-76@2x.png Icon-Small.pngĀ Icon-60@2x.png Icon-Small-40.png Icon-Small@2x.pngĀ Icon-72.png Icon-Small-40@2x.png Icon.pngĀ Icon-72@2x.png Icon-Small-50.png Icon@2x.png

Errors:

iTunes Store Operation failed.
Missing recommended icon file. The bundle does not contain an app icon for iPhone / iPod Touch of exactly ‘120×120’ pixels, in .png format for iOS versions > = 7.0

Screen Shot 2014-11-20 at 3.48.36 AM

 

Solution: Same as before let’s use theĀ Images.xcassets instead of going through all this pain.

you should make sure you have all these sizes of your icon for a Universal App (iPhone and iPad):

1024×1024
512×512
180×180
152×152
144×144
120×120
114×114
100×100
80×80
76×76
72×72
58×58
57×57
50×50
40×40
29×29

Now on theĀ Images.xcassets file for your icons there are different pt numbers under each section:

Screen Shot 2014-11-20 at 3.37.55 AM

How this is is that let’s say for “iPhone App iOS 5,6 57pt” you have 1x and 2x so you choose the 57×57.png and 114×114.png, and let’s say for “iPhone App iOS 7,8 60pt” you use (2×60) 120×120.png and (3×60) 180×180.png and so on.

so here you go, you’re done with the static images of your project, for LaunchImage.xib and Storyboard and all other stuff there are tons of websites you can find… so google on!

Screen Shot 2014-11-20 at 4.12.53 AM

%d bloggers like this: