I have a number of atlases (folder.atlas) added to my xCode project, and typically use them to create SKTextures
for my sprites by name. However, now I see that I might need to share some images between Sprite Kit and UIView based classes.
SKTexture* texture = [[SKTextureAtlas atlasNamed:@"Jetpack"] textureNamed:imageName];
//how to get UIImage?
Is there a way for me to get a UIImage out of an atlas at runtime?
Yes you can, but I'm warning you, it's not going to be pretty. I don't write out the entire code here because it would take too much time.
If you look in your apps bundle, you'll notice that all your atlas folders are there with an appended "c" (probably for compiled).
If I have an atlas called "graphics.atlas" in my project. In my bundle "Resources" I will then find a "graphics.atlasc" folder. It has two or more files (depending on the size of the atlas, spritekit can split it up).
The files: graphics.1.png graphics.plist
Both can be accessed by any UIKit based code as you please. You'll need to have a look through the plist file though and parse it to find the right place for your image. This is not super easy, but it's definately possible to do.
I'm tempted to write a "SKTextureAtlas+UIImage" class, maybe later.