MSStickerView shows black background

I'm seeing this problem in my own app, but it also shows up in the IceCream iMessage sample app. If you run on an iPhone 7 (simulator or actual device), when you start to drag a MSStickerView (that is sitting in the cell of a UICollectionView), it shows a black background behind the sticker. Once you place it in a converstation, the background goes away, but it shows up from the minute the "pick up" animation starts. The exact same code running on an iPhone 6 (device or simulator) does not show this problem. The iPhone simulator is 10.0, the device in 10.0.1, for both the iPhone 6 and 7 cases.


Anyone else seeing this?

Found the problem - it was a bug in the IceCream sample code (which I had reused). When it creates PNG files, it uses the new UIGraphicsImageRenderer class, but does not pass in a format option. This format option allows you to mark the rendered image as opaque or not, and defaults to opaque. The code was rendering a clear background, but ultimately was not creating a PNG with true transparency. Passing in a format marked as not opaque when creating the image not only fixes the background color problem I was seeing when used in a MSStickerView, it also creates a MUCH smaller file.


I'm guessing the iPhone 7 hardware just deals with the pseudo-transparency of the generated PNG files in a different way, due to new graphics hardware.

MSStickerView shows black background
 
 
Q