IOS 10 Swift programmatically gets sticker from Stickers.xcstickers

I have a sticker Stickers.xcstickerswith several stickers. I would like to programmatically get one of these stickers and put it in MSStickerViewwhich I have in UICollectionViewCell. I know with UIImage, it's easy, and you can just do

let myImage = UIImage(named: "myImage.jpg")

Is there an equivalent to this with MSSticker?

let mySticker = MSSticker(named: "mySticker")obviously does not work.

There is MSSticker(contentsOfFileURL: URL, localizedDescription: String, but I'm not sure how, if possible, to correctly implement it similarly to UIImage.

Thank.

+4
source share
2 answers

, . , , URL- (pathForResource .xcassets).

, , .

+3

BJHStudios , ! , . , , BrowserView MSSticker (contentOfFileURL: URL, localizedDescription: String).

0

Source: https://habr.com/ru/post/1655664/


All Articles