iOS app release, image resolutions - ios

I have a simple, single view iOS app. I have an image which is to be used as the full background. Currently, i have edited the image for both portrait & landscape, in standard (414 X 736) & retina (1242 X 2208) for iPhone 6.
When i use iOS simulator, the background appears fine in all of the devices (4s > 6 plus). However i'm unsure about if this will hold out when launched/released.
Do i need to provide the image in all different resolutions for each device in my final app?
e.g imagePortrait4s.png, imagePortrait5.png, imagePortrait6.png, imagePortrait6plus.png etc

Since your image needs to be the same size as a launch image, your best bet is following the requirements for those: iOS Human Interface Guidelines - Icon and Image Sizes
Since the documentation does not state that providing the larger images for the iPhone 6 is sufficient to provide a good launch image for older phones, assume you need a 640 x 960 image for the iPhone 4s.

Related

How make iOS app look same in iPhone 5, iPhone 6 and iPhone 6+

I am building an iPhone app using Swift, XCode 7.3.1 in Portrait orientation. We have been provided Visual Displays (from our designer) for the screens that need to be in our app. As developers we need to match the app screen elements exactly to the Visual Displays provided. We have used Auto-Layout but the match for the various elements in the screen is not exact. eg. We are having problems in changing the font size as per the iPhone model etc.
So currently we have a switch statement where we are checking the deviceModel and increasing the size of elements by a fixed percentage for iPhone 6+ and decreasing by a fixed percentage for iPhone 5/5S. Our Visual Display is based on iPhone 6 screen size so we are keeping iPhone 6 as base line.
I am sure there is a better way of doing this.Can some one please help me on this issue.
Okay let me share my way to handle this situation.
My application is designed for :
iPhone 5 - Screen Size 4.0 inch
iPhone 6 - Screen Size 4.7 inch
iPhone 6+ - Screen Size 5.5 inch
My BASE phone is iPhone 5 Screen (4 inch)
So I asked designer to have PSD design having 4 inch size,
and same I have followed while implementing in Xcode's Storyboard
and most important once you have proper design, and font for the layout.
we need to carefully define Auto-Layout.
Note: All the required assets/icons goes in three sizes
1x for iPhone 5
2x for iPhone 6
3x for iPhone 6+
The trick is in the splash.
Default-568h#2x.png 640 x 1136
Default.png 320 x 480
Default#2x.png 640 x 960
Just add in project, only drag and drop no more, you don't need add this splash anywhere, just leave them in the source project. The project search by this names and read with the same design the app in all devices, inclusive ipad.
More info here
First, you don't use a switch based on three possible devices. First, you mess up iPhone 4s users and you mess up gazillions of iPad users (if you don't have an iPad version then the iPad displays a blown up 4s screen). Second, you have no idea what resolutions future devices have. And if you ever want your up to run properly on an iPad, there are two sizes, you should be able to rotate, and then you have five ways to split the screen.
The big mistake is at the very start: That you insist on matching a given design pixel by pixel. Send your designers on a course where they learn how an iOS device works. I'll quote Fogmeister, print this out in large font and hang it on your designer's desks: "They are different devices. Your app will look different on them all. Your app should look different on each of them. Your designer should know this and provide designs that fit each device."
Even if you wanted to have the 5, 6 and 6+ screens look the same except for size, that's bad design. Larger fonts are not just larger. The same font at 36 pt is not just 18 pt under a magnifying glass, there are subtle differences. Thickness of lines should not be scaled up when the size is larger, so you get bad design there.
To actually use the larger screen size, either build against the iOS 9 SDK, or supply launch screens in the required sizes (up to iOS 8, Apple assumes that if you don't have a 6+ sized launch screen for example, then you don't know how to handle the device, so they simulate a smaller one).
Then you read the screen size and use that to scale things, or use auto layout. Auto layout is a beast that you must learn how to handle. It takes time. And make sure that a 6+ can display more information than a 6 or 5, otherwise owners of larger phones will be annoyed with you.

Image resolutions to supply for adaptive iOS app

While developing an iOS app I invested a lot of time in making everything adaptive (size-classes and so on). I have implemented an few image scrollers / photo galleries that are screen wide and zoomable. What is the best practice related to multi-screen image storage and exposure?
It is not a problem to store or generate on the fly, let's say, five different resolutions for every image and load the best resolution depending on network connection and screen size. I want to know what is recommended for this sort of diversity.
This is a (perhaps incomplete) list of all the possible image resolutions based on screen size:
iPad landscape & portrait: 704px wide
iPad 2/3: 694px wide
iPad 1/2 landscape: 507px wide
iPad 1/2 portrait: 438px wide
iPhone 6+: 414px wide
iPhone 6: 375px wide
iPhone 4/5 + iPad split screen right-side: 320px wide
All my images are square. So height equals width.
Do I include retina photos or should I use #1x for photos? Do I add extra pixels for the zooming (1.5x max)?
This is are basically the current resolutions for iOS Devices.
Basically in the retina devices you need to provide #2x images if you want them to appear not pixelated. Also in the iPhone 6 Plus and 6s Plus you will need to provide #3x images.
In the following links you can find more information about it.
http://ivomynttinen.com/blog/the-ios-design-cheat-sheet-volume-2/
http://www.idev101.com/code/User_Interface/sizes.html

full screen image sizes and naming in xcode

I'm a bit confused here. If, say, I want to set an image as background (full screen) for my ios app (iphone), what are the sizes for the image I have to make? I googled and found no clear answer yet.
Using image assets gives no explanation either. I tried creating new image set, it just shows 3 slots for 1x, 2x, and 3x. How the xcode differentiate between what image to use for iphone 5 and iphone 6 (different ratio)?
EDIT
I seem to be unclear about my question. If the image for iphone 5 and 6 is the same, doesn't the aspect ratio differ? It will be stretched on one device or vice versa on the other and I don't want that. Back before the iphone 6, I just create image .png, #2x.png, and -568h#2x.png with the size 320x480, 640x960, and 640×1136. So my question is, for iphone 6 and 6+, what is the naming and size for my images?
If, say, I want to set an image as background (full screen) for my ios app (iphone), what are the sizes for the image I have to make?
You can use [UIScreen mainScreen].bounds's width & height to setup your view frame.
it just shows 3 slots for 1x, 2x, and 3x
They're not used for handling ratio of displaying, just for display solution (retina or not). You can just use xxx.png in your code, and it'll choose to use xxx#2x.png or xxx#3x.png appropriately.
How the xcode differentiate between what image to use for iphone 5 and iphone 6 (different ratio)?
UIImageView has an instance method called -setContentMode:, you can use UIViewContentModeScaleAspectFill mode for displaying in different devices w/ different ratio, i.e., some parts will be cut off.
This link should give you an overview of the differences between the 1x, 2x and the 3x image assets which we get once we create a new image asset.
http://9to5mac.com/2014/08/29/support-for-3x-image-assets-found-in-latest-ios-8-beta-ahead-of-larger-display-iphone-6/
Also when you create a new image asset, you can select image for specific devices such as (iPhone and iPad), if you are only developing for certain devices.
Select the devices as "Device Specific" from the Image Set Shown on the right side of the image.
As for you question, iPhone 5 and iPhone 6, xcode will take the same image assets i.e. 2x, for iPhone 6 Plus it takes the 3x image.
App Icon and Launch Image
Now for the App icon and the Launch image, this following link will guide you through.
http://www.iphonelife.com/blog/31369/unleash-your-inner-app-developer-managing-images-xcode-5-asset-catalogs
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
for the launch image there are different options available, such as you can individually set images for the landscape and portrait images for different devices.

Xcode 6 - xcassets for universal image support

Currently working on a universal SpriteKit project. I'll be supporting the following devices:
iPhone 4/s,
iPhone 5/c/s,
iPhone 6,
iPhone 6+
iPad non-ret,
iPad retina
I am confused on the iPhone part. I already have 4 versions for my background sprite for the 4 different screen resolutions of the iPhones. But which goes to which?
I know the 3x is for the 6+, and I think the 5/c/s goes to the Retina 4 2x, but I do not know where the iPhone4/s, and 6 go. Anyone know?
Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set
Also how do you guys approach creating images/sprites for a universal application? Now that the new iPhone 6, and 6 plus are out, I have 2 more resolutions to support which is still confusing for me as I'm still a beginner.
This is a little confusing - here's how I understand it (this is in reference to the top image):
1x images are for the original iPhone through the 3GS - 'standard' resolution devices (3.5" screens)
2x images are for the iPhone 4 and 4S (3.5" Retina screens) and are also used for the iPhone 6.
Retina 4 2x are for the iPhone 5 and 5s (4" Retina screens)
3x images are for the new iPhone 6+ (5.5" super-Retina [3x] screen)
I believe that the iPhone 6 (4.7" screen) will use the Retina 4 2x images, but I would have to test it.
Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set
If you compare the two images, the lower one has everything the upper one does, except for a 1x iPhone graphic. You don't need that if you're only supporting iOS 7 and above, since iOS 7 doesn't run on any non-Retina phone-form devices. To be honest, I don't understand why the top image has a 1x iPhone form graphic option - maybe because you checked the "iPhone" box in the sidebar?
Also how do you guys approach creating images/sprites for a universal application
For most non-fullscreen images (like a logo), you really only have 3 resolutions to support - standard (1x), Retina (2x), and the iPhone 6+ (3x). These are simply different quality of images, not really different sizes. So if you have a 10x10 image on a standard device, that would mean you need a 20x20 image on a Retina device and a 30x30 image on an iPhone 6+. On all devices, they would show up as a 10x10 image.
A great tool I used for managing different resolutions of icons is iConify.
I create them at the highest size I need (30x30 [#3x] for an image I want to be 10x10 on a device), then save it as a png and resize copies to 20x20 [#2x] and 10x10 [standard]. A better solution would be to create and use vector graphics, which would resize better to any size.
In 1x place image with resolution 320 x 480.
In 2x place image with resolution 640 x 960.
In Retina 4 2x place image with resolution 640 x 1136.
in 3x place image with resolution 1242 x 2208.
Images of Retina 4 2x will upscale to resolution 750 x 1334.
Images 3x will downscale to resolution 1080 x 1920.
You can also visit this links for launch screen images:
http://www.paintcodeapp.com/news/iphone-6-screens-demystified
http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
For all other images resolution and size:
https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
https://developer.apple.com/ios/human-interface-guidelines/graphics/image-size-and-resolution/
https://developer.apple.com/ios/human-interface-guidelines/graphics/custom-icons/
How to use Image.xcassets:
https://www.youtube.com/watch?v=_36Y6rDcKP0&list=PLXCowKcXAVgrCe2Lezv0acRf4adQLshv2
Hope this will be more helpful.
If you have your launch images in an xcasset file, you can do the following in Xcode 6.
Select the launch image asset, select a specific resolution (1x, 2x, Retina 4, etc) and open the attributes inspector (see image below).
Under the "Image" section, you will have a "Expected Size" attribute.
Inside images.xcassets, you can add different devices support by right clicking as shown in the snap
Edit: Well, it doesn't seem working when I drag n drop images to placeholders. It gets messed up as shown next
I don't know why it is acting odd on my Xcode 6.4 though.
Edit#2:
I see a bug from apple here. I can select 'Universal' along with any device upon right click as you can see in the first image above. But via attribute inspector I can correctly select either 'Universal' or specific devices as shown here
Edit#3:
In Xcode 7 the attribute inspector has been changed and now it gives option same like the right click. So instead of either 'Universal' or specific devices, now it offers to select all.
There is one tool : AVXCassets Generator with which you can directly generate XCAssets file for all your icons and images just by one click.
hope you will like it.

Different image sizes for iOS development

According to this link, would I need four different version of the same image size? Originally, I only created one for the iPhone 5, and I used the autosizing feature on storybuilder to resize the image correctly on iPhone 4s and below.
Concerning the four resolutions (***#2x.png): As it is described in https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1 you have to resize some images, for example the App Icon has to be high- and low-resolution,
If you need to support standard-resolution iPhone or iPod touch devices
(Source: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1)
For the other Images, it is not necessary, but as "ta.speot.is" described in https://stackoverflow.com/a/12549329/1113407 it is better if you do it yourself.
And "JustSid" comment
Why should already slow devices do even more work?
(Source: https://stackoverflow.com/a/12549329/1113407)
put it straight: The older devices which do not support retina display are slower and at most times (own experience) your app won't run fluently on those if you do not prepare the app.
Concerning the iPhone 5 vs iPhone 4S:
You need some images in both heights, as it is mention in https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1.
As the iPhone 4S has got the Apple A5-Chip and doesn't have to resize the image, as it has got an retina display, other images don't have to be resized. Therefor you could use the storybuilder-feature... But you have to ask yourself if the app should run on an older, non ratina display device...

Resources