URLs for images in .xcassets

189 views Asked by At

I’m working on a sticker pack app. It’s technically an iMessage extension because I’d like to use advanced features like in-app purchases.

I’ve put all the stickers into the Stickers.xcassets file, but I can’t figure out how to get URLs for those stickers.

I know I can get images from .xcassets by typing UIImage(named: "sticker.png"), but the MSSticker initializer only accepts the URL: init(contentsOfFileURL:localizedDescription:).

How do I get URLs for files in .xcassets?

P.S. I am also aware I can put the stickers into a regular folder in project navigator, and it’s a temporary solution that’s in use now. But the goal is to use .xcassets because it supports certain features, such as App Thinning.

0

There are 0 answers