I new to Swift, so I'm looking for help.
I'm working in an app for iOS that shows a list of data that you can share through the system share. I recompile the app to Work in MacOS too. On iOS works perfect, in my Ventura Mac works fine also... but when I tried to make it work on Catalina, it just don't show the menu, and even the button get grayed out like it get pushed and never released. The code is this:
@IBAction func shareRecord(_ sender: Any) {
if resultado == ""{
print("No Item Selected")
}else{
print("Reenviando \(resultado)")
let text = resultado
let textToShare = [ text ]
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view // so that iPads won't crash
self.present(activityViewController, animated: true, completion: nil)
}
}
So, any ideas?
I tried several times, but nothing shows, I expect to a menu with options appears.