Question

I am trying to reduce the size (30+ MB) of my binary submission, and I sense that images acquire a sizable (>26 MB) part.

I also observed that if I remove retina images (@2x.png), iOS gracefully replaces them with 4-inch retina (-568h@2x.png) versions.

Are the retina images really redundant if I supply -568h@2x.png versions?

P.S.

Not that one image makes much of a difference, but if the answer is a Yes, does this also apply for default.png?

Was it helpful?

Solution 2

In general image@2x can be used as a stand in for image, but not the other way around (because they wouldn't look good). The side effect of doing this is that more memory will be used and on non-retina devices that could cause a problem. If you aren't supporting non-retina devices then you don't need any images.

Generally speaking you shouldn't have many image-568h@2x images other than the Default and other background images. Most of your content images will be the same size no matter what the screen size is. You do not need differently named images for a button of the same size on multiple different screen sizes.

OTHER TIPS

@2x images are for retina devices. They look much crisper and clean on retina devices (e.g. iPad3, iPhone 5) as compared to their non-retina counterpart images. Here are few suggestions to reduce size of your binary.

1) For background images check if they are really needed. If they are simple solid color images you can simply set the backgroundColor of the UIView.

2) Whenever possible use 9 patch (also called 9 scale) images for button or view backgrounds. They are generally 1 px wide images and you can use below method of UIImage to use them

- (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets resizingMode:(UIImageResizingMode)resizingMode  
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top