I have created a custom keyboard with some png images. All of those png images have a transparent/clear background. But when we copy that image and try to send the same in any messaging App, it is showing a white background. If i try some other keyboard Apps, it is working fine without any background.I am using this code:
Please check: Screenshot with white background And: Screenshot without background when sending image from other apps
let pasteboard = UIPasteboard.general
let pngdata = UIImagePNGRepresentation((button.imageView?.image)!)
let imgg = UIImage(data: pngdata!)!
pasteboard.image = imgg