How to save SKSpriteNode as PNG image to Camera Roll?
问题 I'm trying to convert SKSpriteNode as a PNG image with transparency to Camera Roll. This saves the image but not with transparency: let image = UIImage(cgImage: (spriteNode.texture?.cgImage())!) UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) This complains: Cannot convert value of type 'Data?' to expected argument type 'UIImage' let image = UIImage(cgImage: (createdCloudShadow.texture?.cgImage())!) let image2 = UIImagePNGRepresentation(image) UIImageWriteToSavedPhotosAlbum(image2, nil,