Hey! Im a teenager and im pretty new to swift and Xcode. can someone explain how I can import my own images into Xcode in the 1x 2x and 3x format that is required? Currently, I have a few images and I want to use them in my application, so I need to know how and where to change the resolution for each of those images. Thanks in advance 😁
How to create 1x 2x and 3x images to import into Xcode
If it is an image in xcAssets, a single size will work.
Otherwise (and notably for app icons), imagine you have an image 60 * 60.
For the icons labelled as 1x 60pt, use this
For 2x 60 pt, create an image 120*120 (screen capture for instance)
For 3x 60 pt, create an image 160*160
You also have apps to do this automatically (like Icon set creator)
Otherwise (and notably for app icons), imagine you have an image 60 * 60.
For the icons labelled as 1x 60pt, use this
For 2x 60 pt, create an image 120*120 (screen capture for instance)
For 3x 60 pt, create an image 160*160
You also have apps to do this automatically (like Icon set creator)
If your image frame size is 60x60, 1x image should be 60x60, 2x should be 120x120. And 3x should be 180x180.
There are tools in Mac App Store which lets you resize the images to desired sizes so you can resize multiple images at once. You can see this article to get an idea flow about how to create 1x, 2x, and 3x images: https://mic.cognirush.com/optimizing-your-website-for-all-screens/
It's written for web-sites but you can also apply it to get 1x/2x/3x image required by the XCode as well.