Post

Replies

Boosts

Views

Activity

List folders inside Assets.xcassets
I have created folders inside my Assets.xcassets.So I can organize images and group them as "set"Assets.xcasset | Set1 (folder) | | Birds (folder) | | | image1 | | | image2 | | | image3 | | | image4 | | Foo (folder) | | Bar (folder)I would like to use these folders in code (swift) so I can:list all folders in "Set1"pick one folder randomlyLoad all images of that folder in a [UIImage]But I can't find a way to list these foldersSo here are my questions:- Is it possible to use folders created inside Assets.xcassets to do the step 1. and 3. ?- If it is not (well what a usefull folder feature then 😝), what would be the (elegent, easy to maintain/update) way to do that?the cool thing by doing that is that:- the code would be agnostic of how many sets they are (there should be many 20+)- the code would be agnostic of name of images in these sets- it is easy to maintain, few lines of codes, almost no hardcoded names/ref anywhereThe project targets iOS platform
2
0
10k
Feb ’18