2016-08-23 18 views
0

我發現在GitHub上這個回購,使您能夠創建圖像動畫MSSticker:iOS 10消息擴展應用程序:如何獲取由此功能創建的MSSticker?

https://github.com/radif/MSSticker-Images

一旦我呼籲:

let sticker = MSSticker(images: images, frameDelay: 1.0/14.0, numberOfLoops: 0, localizedDescription: "generated sticker") 

如何讓我的貼紙出現在視圖或文本欄?我無法將其作爲子視圖添加到我的視圖中,因此如何顯示它?

回答

1

看着你提供的GitHub鏈接看起來好像看看Apple Documentation about MSSticker應該有所幫助。如果我沒有錯,GitHub repo只是幫助你從一系列UIImage創建一個MSSticker。試試這個:

let yourSticker = MSSticker(images: images, frameDelay: 1.0/14.0, numberOfLoops: 0, localizedDescription: "generated sticker") 
// stickerView is an MSStickerView, which inherits from UIView 
let stickerView = init(CGRect(...), sticker: yourSticker) 
yourView.addSubview(stickerView) 
相關問題