I have this piece of code in my app
guard let codeImage = imgQRCode.image else {
return
}
PHPhotoLibrary.requestAuthorization({status in
DispatchQueue.main.async {
if status == .authorized {
let ac = UIActivityViewController(activityItems: [codeImage], applicationActivities: nil)
self.present(ac, animated: true, completion: nil)
} else {
self.showOkAlert(messageTitle: "Access not granted", messageText: "Code image not saved.", okText: "OK", {})
}
}
})
But content displayed in imgQRCode UIImageView (generated QR Code) is not saved to Photo Library via UIActivityViewController and error "ContactQR[997:63907] [GatekeeperXPC] Connection to assetsd was interrupted or assetsd died" is shown in XCode console log. If I replace guard section with code
let codeImage = UIImage(named: "Ghost")
using picture from Assets it`s correctly shared to Photo Library. Why QR code image not if it's normal UIImage?