0

I wanted to know that how we will manage images assets for different sized iphones in xcode,suppose i have an image name abc.png for iphone 5 abc.png non 20X20 abc@2x.png 40X40

as i can set image name abc.png in xib but as size of iphone 6 and iphone 6+ is different so how i can use abc.png for those large size iphone

I have images for all resolutions
abc.png (for iphone 5)
abc6.png (for iphone 6)
abc6plus.png (for iphone 6+)

i have below doubts in my mind 

1. i have to mannualy set image in code for iphone6 and iphone 6+ by checking the screen size?if yes then please let me know do i have to use only one image that is 1X or have to add 2X image also for all device 

2.i think that as these iphone5,iphone 6 and iphone6Plus are retina displays so i should use only 2X images for these displays?

3.Do we have to use images like giving then name of image in xib abc.png and placing the abc@2x.png for iphone 6 and abc@3x.png for iphone6+ in bundle only and xcode will pick corresponding image at runtime?

Please suggest

KsK
  • 675
  • 1
  • 10
  • 22

2 Answers2

0

You can use UIImageAsset

A UIImageAsset object is a container for a collection of images that represent multiple ways of describing a single piece of artwork. A common use case for UIImageAsset is the grouping of multiple images of the same item at different display scales.

Max
  • 39
  • 8
0

As you said

3.Do we have to use images like giving then name of image in xib abc.png and placing the abc@2x.png for iphone 6 and abc@3x.png for iphone6+ in bundle only and xcode will pick corresponding image at runtime?

you just need to add different resolutions of same image in assets(Images.xcassets) ( i.e abc.png , abc@2x.png and abc@3x.png ) the rest of work will be automatically done by assets and xcode.

check out this

iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development

Community
  • 1
  • 1
Irfan Gul
  • 1,579
  • 13
  • 23