0
How do I correct the following error:
Expression implicitly coerced from 'String? ' to Any
The error is given in the code snippet below:
let frase = lblFrase.text
let textToShare = [ frase ]
///O erro esta nesta linha
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.excludedActivityTypes = [ UIActivityType.airDrop, UIActivityType.mail ]
self.present(activityViewController, animated: true, completion: nil)
do not need to add Uiactivitytype to the elements of excludedActivityTypes. Just pass the cases
[ .airDrop, .mail ]
– Leo Dabus