Xcode Universal Storyboard Size - ios

What's the size in pixels of the universal storyboard in Xcode? I want to create a custom design in Photoshop so I need to know the size for the universal storyboard.

By default the storyboard size is 600x600px but you should not rely on this. Usually you create a design in 640 x 1136px (#2X resolution) and then create icons for each resolution (#1X, #2X - our base, #3X). DPI resolution doesn't matter is this case, just use default DPI 72.
Here you can find resolutions for various iOS device.

Sounds like you are asking about designing the views in your app, right? You should not design to the universal storyboard size of 600x600 because there will never be a 600x600 device. You should instead design for you target devices. Focus your design around points rather than pixels. Unless you are working on really high end graphics, your app will be built in points.
I design everything based on the iPhone 6 and then allow for some variability in the layouts for the iPhone 6 Plus and the iPhone 5 and then finally the iPhone 4 (as an after thought--just squeeze everything in). iPad layouts (sorry about this) are last on the list.
Here's a great chart showing all of the device sizes: http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

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.

Why would you use native iphone 6 resolution in xcode when building your app?

As of yesterday I had an app using mostly static sizes to fit an iphone 5 screen (320 points width). It was working fine in iphone 6 as well thanks to the system scaling up automatically.
Then I decided to add a retina hd launch image and everything became a lot smaller on iphone 6. So I decided to modify my whole application to use dynamic sizes and fonts so that it would fit the two iphone types the same way. And now it is working quite good.
But after these few hours of extra work, I keep asking myself the same question... what was the point? Why would you want to use dynamic sizes that fit both iphones when you can make it work for iphone 5 and let the system scale up automatically?
the use is: more screen estate. You can fit more on the screen.. at the least images or maps could be bigger while buttons retain there size -- they normally don't need to be bigger :) same for the keyboard.
you don't just get everything scaled but you can decide what is scaled and what isnt

Images.xcassets in Xcode 6

I am trying to figure out how to use the xcassets folder in Xcode 6 and I have to say Apple could have done a way better job. I'm a big fan of Xcode but their images storage per type of screen / phone is a nightmare.
First, in my application I am using images which will have a height of half their width. From what I understood, taking pictures of around 1200x600px should do for all types of iphones (full width minus small margin). So I put them in 3x universal, right? If I gave the maximum size why would apple need 1x and 2x ...? Just resize it yourself, no? Is it compulsory for me to give something or will it work by itself? Images are not vector but simple PNGs. In the simulator nothing is complaining and it works well for all types of iphones. Is it okay to leave the other two empty? From I see from the simulator iphone 6 will use downsized #3x images so what is the point of having two images? Only ratio is important and they have the same ...
Secondly, I just added today a launch screen for retina hd 5.5 / 4.7 and now when I run the app in the simulator my uitableviews only take around 4/5 of the full width instead of full width .... can't figure out why adding a launch screen would modify layout of my uitableviews ....? Navigation bar and other screens seem untouched though ...
Any help appreciated.
you need to add the images for the 2x & 3x because when you add large size image then at the run time this image get resize as per the actual width of the image it utilize memory lots of memory to do this & some time if your application have too many images then you will get memory issues
if you want to test this then run your application in iPhone 5 then see the memory utilisation by first keeping the high resolution image now take image which will be of appropriate size to iPhone 5 & then run again you will see the difference
so the best practice is to use different image for different size & not images in this fashion.
The answer to your second Question
if you are not adding the splash screen for iPhone 6/6+ then iOS stretches your UI of iphone 5 to fit into the size of the iPhone 6/6+.
But when you add splash screen it stops doing that.
late to the party but yes you need to manage all this resolution by yourself. Otherwise it will consume more memory.
but yes there is one tool which will make your work less by generating all assets for you
AVXCassets Generator

Preparing assets for iphone 6 spritekit games

I'm making a game in SpriteKit, and positioning cards with code. The size of the card texture needs to be different based on screensize or the layout is screwed. Same with background images of course, or ANY other layout. How does the iphone6 share the same #2x assets with the lower-res screens? It makes no sense. I've heard to design for the 6, and let the older phones down scale. but this doesnt seem to be what is happening. Everything is just cut off when checking on 5s. My assets for 6+ are fine, but of course it uses its own set of 3x images.
Display scale factor doesn't tell you everything you might want for choosing assets and laying out your screen — e.g. if all you have are #2x assets, they're used on both iPhone (4 and newer) and iPad (3 and newer) even though the iPad and iPhone have very different screen sizes.
SpriteKit's image loading falls back to UIKit's, which automatically picks the right scale factor for your device but not the right dimensions. So, much like how you have to do your own heavy lifting to choose different images for iPhone 4/4s vs iPhone 5/5s, you'll also need to look at the screen size yourself to pick images and/or do layout calculations on 3.5", 4", and 4.7" displays.
(Actually, you can get UIKit to automatically pick iPhone 3.5" vs iPhone 4" images if you use Xcode asset catalogs, but it doesn't look like those cover the 4" vs 4.7" issue. That's probably worth filing a bug about.)

What resolution do I need to make images for universal iOS apps in?

I am making a Universal app on xCode 4.4, using Storyboards. I am making the images for this app in Photoshop. I want to make a background image that fills the whole screen.
What I want to know is:
What resolution do I make the images?
Do I need 1 for iPad and 1 for iPhone, or more?
How do you make it work with the iPhone 5 as well?
You might need up to 10 background images:
There's the retina iPad: 2048x1536, non retina iPad and iPad Mini: 1024x768, retina iPhone: 640x960, non-retina iPhone: 320x480 and the new iPhone 5 (retina only): 640x1136.
That's 5. If you want to support both landscape and portrait, then you have 10 combinations.
PS: If you decide to keep the status bar visible (as most apps do), then reduce the height with 20 pixels (40 pixels for retina displays). That's how much room is needed for the status bar.
You should consider the approach of using only one image. The user experience of most apps is poor if you dont respect the available canvas size.
And you might want to focus special areas of your artwork to the user.
I would propose you to implement different scenarios at least for iPad and iPhone.
The resolution itself is described within the specs. So use one for iPhone and one for iPad, the different logos are posted in two resolution, with a postfix #2x or for the new Appstore dimensions with another prefix, but all these details are within the specs.
My experience is that in most cases you have to organise the user interface separately in order to provide a good user experience.

Resources