XcodeEditor icon indicating copy to clipboard operation
XcodeEditor copied to clipboard

How can I add Images.xcassets my project?

Open aybarsyalcin opened this issue 11 years ago • 1 comments

Hi, I have been trying add Images.xcassets of my project. But I can not found solution. Which method I use it. Please help

Thanks...

aybarsyalcin avatar May 12 '15 09:05 aybarsyalcin

It looks like we need to modify XcodeSourceFileType to include a new type 'AssetCatalog' and then add to the following:

static NSDictionary* NSDictionaryWithXCFileReferenceTypes()
{
    static NSDictionary* dictionary;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^
    {
        dictionary = @{
            @"sourcecode.c.h"        : @(SourceCodeHeader),
            @"sourcecode.c.objc"     : @(SourceCodeObjC),
            @"wrapper.framework"     : @(Framework),
            @"text.plist.strings"    : @(PropertyList),
            @"sourcecode.cpp.objcpp" : @(SourceCodeObjCPlusPlus),
            @"sourcecode.cpp.cpp"    : @(SourceCodeCPlusPlus),
            @"file.xib"              : @(XibFile),
            @"image.png"             : @(ImageResourcePNG),
            @"wrapper.cfbundle"      : @(Bundle),
            @"archive.ar"            : @(Archive),
            @"text.html"             : @(HTML),
            @"text"                  : @(TEXT),
            @"wrapper.pb-project"    : @(XcodeProject),
            @"folder"                : @(Folder)
        };
    });

    return dictionary;
}

so that it maps the new type to "folder.assetcatalog"

Having done this, we'd be able to follow the same process as adding an image, but specify the type as AssetCatalog instead.

jasperblues avatar May 12 '15 09:05 jasperblues