I use Image, video and LivePhoto, using UIActivityViewControlleron different social networks.
But when I use LivePhoto on WhatsApp , something like the following happens:
- when an ActivityViewController is present -> click on WhatsApp -> it presents a contact list for the second one and dodges quickly, and when I try to print the error using the
ActivityViewControllerCompletion Handler, it prints something like this:
[core] SLComposeViewController remoteViewController: didTerminateWithError: Domain Error = _UIViewServiceInterfaceErrorDomain Code = 3 "(null)" UserInfo = {Message = Service Connection Interrupted} [core] SLComposeViewController completeWithResult because it already dispenses with SLComposeViewlerdrol, because it rejects SLComposeViewController, because it dispenses with the controller dealloc
I have tried with this code :
PHImageManager.default().requestImageData(for: selectedAsset, options: nil, resultHandler: { (imgData, str, image, info) in
activityItems.append(imgData!)
let activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.completionWithItemsHandler = {(activityType: UIActivityType?, completed: Bool, returnedItems:[Any]?, error: Error?) in
print("activityType ----- \(activityType) || error ----- \(error)")
}
DispatchQueue.main.async {
self.navigationController?.present(activityViewController, animated: true, completion: nil)
}
})
can someone help me with you.
Thanks.
source
share