Reputation: 2073
I've a problem to include new app icons. What I've already done is the following:
I archived and validated my app and got the information that icons with the resolutions 120x120 px, 152x152 px and 167x167 px are missing. So I created that PNG files and stored it in a folder in Finder.
Then I selected the root node in the project navigator (Xcode 8.2), went to the "General" tab and opened the "App Icons and Launch Images" disclosure. There I clicked the arrow icon. The asset manager is displayed with the entry "AppIcon" selected. So far so well.
Now the documentation says that I have to drag and drop my PNG files from the Finder to that asset table.
But my problem is that I'm a screenreader user so I can't use the mouse to handle such actions. That's why I want to ask whether there is an alternative way with a keyboard shortcut or over an import menu or maybe I can include the PNG files manually f.e. by editing the Xcode project file with a text editor? Thanks a lot for any help!
Upvotes: 6
Views: 9986
Reputation: 19602
The Assets.xcassets
is simply a directory whithin your projects directory. You can modify the default app icon set by placing the .png files in:
Assets.xcassets/AppIcon.appiconset
and modifying the contained Assets.xcassets/AppIcon.appiconset/Contents.json
file like this:
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "yourFileName.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "yourFileName.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "yourFileName.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "yourFileName.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "yourFileName.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "yourFileName.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Maybe you have to create the JSON file.
Upvotes: 6
Reputation: 3158
Yes there is an alternate method to drag-and-drop:
1) Click on the assets.xcassets
2) Right click (or control-click) "AppIcon"
3) Click "Show In Finder"
4) That should take you to the actual folder where the icon set gets stored. You can copy all the individual image files (make sure they are named properly for XCode to differentiate between sizes) from wherever you have them stored, and then just paste them in here via Finder.
5) After you paste the image files in the folder, make sure they actually get pasted INSIDE the AppIcon.appiconset folder ~ they should be accessible through XCode.
Hope this helps
Upvotes: 1