Asset Catalog: Access images with same name in different folders Asset Catalog: Access images with same name in different folders xcode xcode

Asset Catalog: Access images with same name in different folders


Click on each folder in the assets catalog and select Provides Namespace in the Utilities View:

enter image description here

You will see that the folder then becomes blue and you can see the path to the image above the images.

You can then access the image like this:

imageView.image = UIImage(named: "folder1/Image")

or in Objective-C:

imageView.image = [UIImage imageNamed:@"folder1/Image"];