Reputation: 1919
I heve Assets catalog like this
how i can get image depend of component (folder) ? I like to use something what it is
let image = UIImage(named:"ComponentA/Background")
but this doesn't work
Upvotes: 3
Views: 4164
Reputation: 2958
you can get image depending on folder by "Providing Namespace" to folder.
var image : UIImage = UIImage(named:"New Folder/bgimg")
Upvotes: 5
Reputation: 1750
folders are for our reference only
you need to provide different names, and use only image names in programming.
Upvotes: 1