Localizable xcassets files? - image

In previous versions of xcode you could set image files as localizable files and import different image files for different locales.
I cannot seem to do this using the new XCAssets functionality in Xcode 5. Is there a way to do this within the xcassets structure? Or do I have to import the images as separate files.

I've also looked for this, and after some time looking around it seems that is not possible for the moment using the xcassets, although it may change in the future... or not
Apple currently recommends that the launch image should simulate the app first screen but without content.
Apple launch images guidelines

Yes seems not possible with xcassets for now as per Macistador answer.

Related

Is it possible to use custom icon for Xcode file template?

In our project we generate multiple swift files when using the file xctemplate configuration. However, with this configuration, there is no icon displayed in Xcode when generating the files (see attached image). We did try to add two images to the template folder: TemplateIcon-png and TemplateIcon#96.png which yielded no success. Is it possible to use a custom icon for file templates in Xcode?
Not sure if you're still looking for an answer to this, but you should be able to create an .icns icon package named TemplateIcon.icns. This should contain your template image(s) to be displayed in the new project picker.
I suspect your issue was trying to use the PNG assets directly.
See the Base Acceptance Testing Bundle for an example. It is part of the OCSlimProjectXcodeTemplates repository.

Use of xcassets versus design team

Design team provide a folder with all the images required for a project.
I've create xcassets for the icon and splash files, and for some images who require slicing, etc
I've notices that all the image in xcassets have been duplicate in the xcassets folder.
My question:
From xcassets, can I link to image, instead of having xcode
duplicate it?
If link not possible, what are the best way to work with design
team?
Do you thing that, at compile time, xcode will insert just one copy
of the image?
Thanks for your infos
The purpose of xcassets is to consolidate all of your project assets into a nice bundle. I tend to split into multiple xcassets for larger projects. After you pop everything to xcassets, you can get rid of other asset instances from your project.
In compile time, only the files selected in the "add to target" field will be copied over.
Just stick all your files into xcassets, don't add them anywhere else.
yes ofcourse there is one tool for your problem's solution
AVXCassets Generator
Hope you will like it

What is the best resource for placeholder image files in various formats?

I'm developing a cross-platform desktop application that handles a range of image files: anything from .jpg, .xpm through to .tiff. The application even needs some .ico files because it runs in the systray and I want to see that the icons change with changing application states.
As a developer I don't want to spend even ten minutes searching for files.
Is there a definitive one-stop-shop site for placeholder / fake images so that developers can use these just get on with their work, with the intention that they'd be later replaced by a designed image before release?
if you love kittens here you have resource with cute kittens images:
http://placekitten.com/ ;)
yeah there are some resources out there, which you'll find by using Google.
Here's one: http://placehold.it/
You could check out http://lorempixel.com/ - A play on Lorem Ipsum.. only... for pictures instead of typeset.

Delphi - Want an automated way of maintaining the link between a "source" image file and images in my project

One thing I find Delphi doesn't manage well is the link between image "source" files and the image components in my project (D2006 here but I'm assuming it applies to all versions).
Say I have various static images in my project - backgrounds, toolbar button glyphs, various bits of eye candy, etc. I have a corresponding collection of PNG/BMP etc. files that I have sourced, scraped or created, and these have been loaded into the image components at design time.
One problem is that there seems to be no automated way of finding out three months later what source image file was used to load an image component. This becomes more of an issue when you need to edit one or more images.
So what I would really like, is some way of including the image source files in a build of a project. I.e. when I did a build, all of the image components would be reloaded from the sources first. At present, when I modify some of my images with PhotoShop or similar, I'm faced with a lengthy and error-prone process to reload the altered images into their respective image containers.
Is creating a resource with all of the images bound into it and adding code to load the image components at startup a viable way to go? Do others have this problem, and how do you manage it?
None of the standard components support what you are asking for. However, Thany's TPngImageList component does support the ability to associate a user-defined string with each image in the list.
Otherwise, to know which file belongs with which image, I would suggest using an .rc file to compile the external image files into the app's resources at compile-time, and then you can load the image resources into your components dynamically at run-time instead of at design-time. That way, you can manage the image files however you want. When you change a file, it will automatically be linked into the app on the next compile.
You might load the same images in runtime, and add these images in version control to ease maintenance. There are also command line tools for Lazarus (I guess you might find similar for Delphi too) which can put files into resources that you app can later use.
I load the images from ico files, populate a imagelist and then use it in my Virtual string tree for various nodes. Easy to change the ico files.
/Mikael

Interface Builder doesn't show some of my resource images

I have almost 20 images in PNG format added to my current project on Xcode (under the proper group, Resources). Unfortunately, library window's Media tab doesn't show some of them. And if I create an UIImageView and set one of these invisible images from code, nothing shows up. I also tried from IB with adding a UIImageView and set its source image.
Is this problem a image format related issue or is there a tiny detail I'm missing.
What log says:
Could not load the "07_clock_icon.png" image referenced from a nib in the bundle
The solution to this is a bit silly, but it definitely works:
Close XCode and the Interface Builder. Now, instead of opening XCode then opening the project, navigate to the project in Finder and double click on the project. When you open your xib file the blue file not found images will flash up, then be replaced with the correct images and the dropdown will show all your images in the Inspector.
Heyy! I figured it out. It's a refreshing bug. So just copy and replace those images that did not load into your project folder, and then hold Shift Command K (to clean your project). After Clean Up it should work perfectly! Enjoy!
If you dragged the images from the Finder into the Resources folder in XCode the images should show up in IB as well. At least it does so in my setup.
Maybe the images are 8-bit PNG images. I believe Cocoa requires them to be 24-bit because of the alpha transparency. PNG 8-bit doesn't support the alpha channel, as it's more like a GIF image.
But from the error you posted It seems IB couldn't find the resource at all. Which is understandable if it doesn't load the resources from XCode in its library.
Assuming you selected the option to let XCode copy the files into your project and neither XCode nor the Finder complain when you make the copy... I wonder if there might be some file corruption? Maybe try recreating them or opening and resaving them from another graphics application (or even Preview.app).
btw- 8-bit PNGs have worked fine for me.
Same problem was encountered by me. The problem is with the image. The image has been some how corrupted.Try to open the image in photoshop and you will see it doesn't open with photoshop.
I solved the problem by changing the image format to PNG-24 and everything works fine for me.
Hope this will solve your issue.
Regards,
Rupesh R Menon

Resources