pixel perfect iOS app design conflicting with auto layout - iphone

Client has provided me with PSD designs for iPhone 5. When i am trying to implement the same I've found that apple follows point convention instead of pixel which is roughly like 1 point = 2 pixel for retina display.
When i am trying to implement those design on Xcode it looks weird though. Say for instance the top navigation bar is 92 px (as per client). I made it half and implemented 46 pts on Xcode. It matches up when i compare the screenshot from the iPhone 5 with the PSD's. But as soon as i run it on iPhone 6 real device it looks pretty much tiny.
How to solve this issue and how am i suppose to have same aspect ratio on all screens considering I was putting constraints as 0,0,0 left,top,right and 46 pts height.

Related

background images are grainy and slow with iOS 8, iphone 5s

My client asked me to put a bunch of random background images on his iPhone app. So it's set up by putting a UIImageView on top of self.view, adding an FXBlurView on top of that (for blurring purposes, obviously), then putting a UIScrollView on top of THAT, and laying translucent UIViews containing control objects on top of all of it. it looks something like the yahoo weather app when all is said and done. my question is twofold. now that i've explained the situation, here are my two questions:
Question 1
the background images are very grainy. what size should they be for an iphone 5? and what size for an iPhone 6? i thought retina was 640x1136, which should be the minimum size right? why is it only showing the entire image for 320x568? from what i've read, they should be the following for a 5s:
320 x 568
640 x 1136
960 x 1704
when i do that, they appear very grainy. if i do any larger than that then the pictures are cut off. the whole picture isn't being shown.
Question 2
In iOS 7, the app ran fantastically. now that iOS 8 is out, the scrolling graphics are slow and choppy. I took the background image out completely and it sped right back up. I'm wondering what i can do to speed the scrolling up again with a background image staying stationery while the control objects scroll.
any ideas for me?
Answer to the first question
apple has you design your apps at 320x568. The extra pixels are used to make the text and images look sharper. Otherwise, everything would be smaller on a retina display and not sharper.
So you don't have direct control over that extra retina space. The iPhone uses it to digitally make the images sharper and clearer.
I'd still like to know why its choppy and the graphics are poor while scrolling
I use FXBlurView as well, and found that turning the dynamic option of the blur view to OFF fixes the issue. For some reason on iOS 8 FXBlurView uses 100% CPU when dynamic is ON.

Why does iPhone app resize for iPad but not iPhone 5

Why do original iPhone applications (normal screen size like iPhone 4/4s) in Xcode resize perfectly for iPad automatically and not for the slightly larger iPhone 5 screen size?
To fit a iPhone 4 view into the iPad each point is scaled equally into two directions. The aspect ratio of a iPhone4-point doesn't change on the iPad screen.
To fit a iPhone 4 view onto the iPhone 5 screen, each point has to be scaled in vertical direction only. This will distort each point and the view, similar to the distortions you get when you watch a movie in the wrong aspect ratio. A circle on the iPhone 4 screen won't be a circle on the iPhone 5. So you can't physically resize the pixels like it's done on the iPad.
In iOS-Development Autoresizing Masks come to the rescue. But there is no way to figure out if your app looks good if the auto resizing scales the view to iPhone 5 size. You have to test each app on a iPhone 5 sized screen. Apple didn't want to do this, so they put an opt-in in place, which you actively had to enable. They choose to use the iPhone5 launch image for that.
If your app looks good when it's vertically scaled simply provide the appropriate launch image.
If you used best practices to develop your iPhone 4 app that's basically all that is needed.
iPhone 5 support needs to be explicitly added by supplying a "Default-568h" start image.

How do I cater for all iOS platforms using cocos2d

I want to use Cocos2D framework, but I want to know how to place an object once in code, and for it to appear in the correct position on all devices.
He want's to know how to make universal code for his game.
E.g. Place something dead center for all formats.
Cocos2d automatically fixes positioning for iPhone4.
It uses POINTS not PIXELS to place objects onto the screen, this is your first problem fixed.
For iPad, you need to do some work. I suggest reading this post.
http://michaelgilkes.info/cocos2d-using-hd-images-for-ipad-in-a-universal-app/
I found it helpful and a very good stepping stone to come to a conclusion that allowed me to create a universal application with very little additional code.
I honestly have no idea what you're asking, but possibly you want to know the screen sizes. Here they are in pixels:
iPhone < 4: 320 x 480
iPhone >= 4: 640 x 960
iPad: 768 x 1024

Best way to set the size of UIViews size in iPhone application (so everything looks good on both Retina and older display)

I have the following problem. My application has a tab bar at the bottom and a simple TextView above. In order to fit well TextView above tab bar I had to resize it (I did it through Interface Builder) - I just set height to 401px (usually I hate to do such things).
Then I have tested application on the simulator, to my surprise everything looked o.k. on both standard iPhone display and Retina display. Since I do not have an iPhone I am wondering if everything would look good on the real device as well.
So, my question is: how to set the UIView size so it follows best practices and, what is more important, GUI looks good on both Retina and older display.
BTW: I know how to deal with icons and graphics to make them look good on Retina and older display, I've read all the relevant stackoverflow posts on the subject :)
Size is same on both standard and retina display. It's measured in points. Number of pixels depends on display density.
Pixel != point.
Look at UIScreen scale property. For standard screen it contains 1.0 and 2.0 for retina (iPhone 4). It can contain different values, even not integers.
If you set size UIImageView size to 100x100, it will have same physical size on standard and retina display. But on retina, it will show you much nicer image, because 100 points contains more pixels.
The units in Interface Builder are now interpreted as points not pixels. Therefore it will look the same on both types of displays. On old displays 1 point equates to 1 pixel. On Retina displays 1 point equates to 2 pixels.

What resolution should my iPhone App Icon be?

What image resolution can/should be used for the icon.png file for an iPhone app? I know the size is 57 x 57 but what about the resolution?
Resolution only matters when you are trying to match the size of an image across multiple devices (print, screen, etc)
App icons are always 57x57 and will display without any scaling thus resolution doesn't matter (you could save it as 72dpi, 65535dpi or missing the dpi metadata entirely--SpringBoard won't care and will draw it the same in all three cases)
Here is the link to Apple guidelines, with the sizes for iPad, iPhone retina, etc:
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/AppIcons.html#//apple_ref/doc/uid/TP40006556-CH19-SW1
The "resolution" matters, but don't confuse "resolution" with dpi. Dpi is a measure used for printing, it means "dots per inch". It works like this: if you have an image of 100 x 100 saved at 100dpi, it will measure on paper exactly 1 inch (100 pixels per inch).
The dpi for the icons doesn't really matter, as they are intended for screen display only, not for printing.
It is customary to save images as 72dpi - the so called "screen resolution", because the old 14'' monitors (remember those?) could only display a maximum of 72 pixels per every inch of screen. This is no longer true, especially for the "retina" display of the iPhone. It has a much denser screen resolution, it can show much more pixels in a single inch than the older models of the iPhone. This is why you have to save 2 icons: one for retina display at 114 x 114 pixels, and another for the older iPhones, at 57 x 57. Again, the dpi doesn't matter, because whatever dpi you choose, the number of pixels on your image does not change: it would always have exactly 12,996 pixels (114 x 144).
I have had the best luck submitting to the App Store with 72dip, 57x57 icons.
I only want to say that the DPI (or resolution) is a value that only makes sense when an image is printed. The DPI acronym stands for Dots Per Inch, and it only tells the printer to draw that specific number of pixels by inch of paper. While working on screen devices, the DPI isn't important at all.
If creating new images for the iPhone work with the image size in pixels i.e. 57 x 57 for icons. If you work with image sizes set in millimetres or inches, you'll find that 10mm on your monitor equates to only 4.4mm on the iPhone. The iPhone resolution is 163ppi which is over twice (2.25) the 72dpi resolution of a normal monitor. There is another good reason for the question, in that you may need to provide larger images for marketing (websites, blogs, banner ads, or even printed material) requiring zoomed in images that remain super sharp. In these general wider use cases I prefer to work at 300 dpi at the largest target size and then resize/resample image and resolution when done.
57 x 57 and Apple takes care of the rest. Apple suggests that you have larger, more detailed graphics for, in the event, that your app gets selected as a feature app.
The iPhone 3GS and prior display is 163dpi, so if you intend to create icons that are of a particular size relative to how they are shown, that should give you enough information. Note that the icon must be 57x57 pixels to be shown at that dpi.
The iPhone 4 and later and the fourth generation iPod touch and later have 326 dpi displays, and the icon must be 114x114 dpi to be shown at that dpi.
57x57, as said.
You can chosse by code if let Apple to add the "shiny effect" or if you'll do (or not) it by yourself