Do I still need low-resolution images for using Interface Builder when developing iPhone app for iOS 7? - iphone

I started to develop an iPhone app for iOS 7.
Since iOS 7 does not support devices with non-retina display for the iPhone/iPod touch, and it uses high-resolution images on non-retina iPads (iPad 2 and iPad mini) in the iPhone emulation mode, now I think we don't need to provide low-resolution images when developing an iPhone-only app which deployment target is iOS 7.
I thought it's great, but soon I faced a problem when I used a Storyboard; apparently Interface Builder can not display high-resolution images which file names end with #2x.
I feel it's really pity that we have to provide the low-resolution images ONLY for the Interface Builder...
Is there any good workaround for this? Or do we still have to provide low-resolution images if we want to use the Interface Builder?

You are correct that an iOS 7 iPhone-only app is not going to run on any single-resolution devices, so you only need to provide double-resolution images. Do what you have always done in the past: refer to your image as myImage but name the actual image file myImage#2x.png. Even better, use the asset catalog! Place the double-resolution image in the 2x slot and refer to it by the name of that image set. Either way, this will work perfectly both in the storyboard editor and in the running app; in the storyboard editor, the Media Library and things like buttons that have images will display your image's name as myImage.

Related

Images to Target Specific iPhone Models

Say I have an image which is half the height of an iPhone 4s screen display, when this image is loaded to an iPhone 5 clearly this size is no longer half the size of the iPhone, as the iPhone 5's height is slightly larger then the iPhone 4s.
My question is, like using the image 2x and 3x, is there a way of adding images to your app that target specific iPhones? So that the other images not targeted will not be downloaded with the app.
Or will I need to add images of various sizes to the app and then in the code, say if iphone4 load this image, if iphone5 load this? The only reason I don't want to do this is because I will have 3x the amount of stored images (target iPhone 4, 5, 6) than I would for the iphone6 plus or iPad.
What I was hoping for something like image#2x~iphone4.png or image#2x~iphone5.png, but this doesn't work.
David Cao's answer is correct for bundled image assets, but you have mentioned that you don't really want to include this many assets with the app.
You may want to look at the App Thinning features of Xcode 7 / iOS 9, along with On-demand Resources this will allow you to load your required images into Xcode but the App Store would only download the resources required for the device being used.
If you still need to support iOS 8 you would need to have the images stored on a remote server and load them in when needed.
Take a look at image assets, it solves the exact problem you've stated.
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/Recipe.html
What it does is allows you to provide 1x, 2x, and 3x images which can be referenced as a single name, when you call [UIImage imageNamed:#"imageNameHere"].

How to add seperate iPad and iPhone images in spritebuilder- Cocos2d 3.2

I love that Spritebuilder takes the retina iPad image and automatically makes the scaled down iPhone images.
I make one image (ipad retina), And spritebuilder makes the iPhone ones automatically:
But for certain buttons/sprites, I wanted to make both the iPad and iPhone images myself. How do I add custom iPhone AND iPad versions for an image that can be used in the Spritebuilder UI?
Eg. Use one image for iPad (retina), But use another one for iPhone.
Also, how do I add something like an external spritesheet into my Spritebuilder XCode project? (Adding the -hd or -ipadhd suffix no longer works, it just always chooses the one with no suffix) -I heard is has something to do with 'resources-phone'?
If you select an image in SB you can see its preview image in the top half of the file view. Below the image are 4 smaller buttons labelled auto, one for each platform (phone, phonehd, tablet, tablethd).
For instance, select your ipad image, then drag and drop another image to that image's phone and phonehd auto buttons. That way they override the original image when the app is run on a phone or phonehd device.

xcode Use the same images and xibs for iphone and ipad

I am at the start of a new game. My last game was for the iPhone, and it had to double up for iPad.
Now with the iPhone 5 screen being larger than 4, and iPad and iPad mini, I want to program the game to display the correct size images. Is it possible to design large graphic for iPad and use the same images for iPhone (just display the image smaller when using iPhone 4 etc) or is it best to use two lots of images, iPad version and iPhone version? The problem here would be the size of the app. The App would double the download and install size as the graphics would be quite large, and this isnt something I want to do.
Is it possible to use the same xib for ipad and iphone, and then I could just get the code to detect the screen size and display the game correctly based on that?
Also, I have started the project as Cocos2d with Box2d with the latest download of Cocos2d. It starts off with just the code, should I work from the storyboard instead?
thanks
1) You cannot use single xib file for both iPhone and iPad (programmatically you can but that would screw your app).
2) While doing development using Cocos2D, my experience suggests do not use any xib or storyboard file. Else you will end up in a mess.
3) As far as the question for image size for different iOS devices is concerned, I would suggest you to go with separate images (only typical ones) for different iOS devices. If you have some buttons and simple curve based UI go for CoreGraphics so that you do not need those images. Only use images that are typical ones and use CoreGraphics for rest of the images

How to make an iphone and iphone4-retina compatible app (done in cocoa) easily adapted to ipad?

My question is simple: when an iPhone app also supports retina display, it does not need an additional xib file. (Fonts and images are auto-scaled, you just need to prepare double-resolution images.) I want that retina view also applies to iPad and hence there's no additional xib files. (Scale a bit and leave a bit margin, maybe.) Yes, I just want it look bigger, but not in the low-resolution version scaled up from 320x480.
The iPhone, even with a retina display, is not an iPad. You can update your targets and xcode will convert automatically your views to use the entire screen of the iPad, but it won't make the application conforms to
1. Apple guidelines
2. Users expectations of an universal app.
But, as I said, if you do update your targets, your app might look relatively good (just programatically use UI_USER_INTERFACE_IDIOM to use the #2x.png version of your images).
Edit: I misunderstood your question, and now the corrected answer:
There's nothing you can do. The iPad will launch the app as an iPhone app (the small non retina display, pixelated if double sized) if it is defined as such in your plist, and iTunes Connect will sell your app as universal if it isn't defined as an iPhone in the info.plist.
You basically have little choice here but to port the app or to more or less forget about iPad users. And Apple certainly wanted things to be that way...

Will my iphone 3gs app work ok on iphone 4?

So I'm currently making an app that supports both iphone 3gs and ipad (this is a universal binary app).
What I'm wondering is how will iphone 4 users view my app, will they see it pixelated? will they not see it full screen since my iphone 3gs is on a smaller resolution?
I don't have an iphone 4 yet but I'd rather just release this app as is - just for 3gs and ipad. Is there anything that I must know / any precautions etc? Oh (i just thought of this) is there an iphone 4.0 simulator so i can check out if my app works okay?
Thanks!
Basically any bitmap graphics (PNG files) will look a little blurry on the iPhone 4's Retina display.
The easiest way to fix this is to make double scaled versions (100x100 becomes 200x200) of all your PNG files and add them to your project suffixed with "#2x.png". In other words, MyBitmap.png will become MyBitmap#2x.png. Luckily your code doesn't have to change. On the iPhone 4 the OS will automatically choose a #2x.png instead of the regular one when you do:
UIImage *myBitmap = [UIImage imageNamed:#”MyBitmap.png”];
Xib files will also use the #2x.png if there is one available.
Other than that there's also launch images and Application Icons to worry about. This blog has a good summary.
Yes you can change your device type, by in the simulator pressing: Hardware->Device->iPhone 4 If you don't have it you might want download the latest devevloper tools.
Also you might have to press Window->Scale->100%