I've a custom table view cell which has a label view. I added tapGesture to invoke a function when that view is clicked. Currently my custom view cell is in it's own swift file. I added following code to enable 'Share extension' when clicked on that label.
CustomCellView.swift
10 myLabel.isUserInteractionEnabled = true
11 let tap = UITapGestureRecognizer(target: self, action: #selector(tapLabelGesture))
12 myLabel.addGestureRecognizer(tap)
13 func tapLabelGesture() {
14 print("Clicked on Label ")
let url="www.google.com"
15 let activityVC = UIActivityViewController(activityItems: [url], applicationActivities: nil)
16 activityVC.popoverPresentationController?.sourceView = self.view
17 self.present(activityVC, animated: true, completion: nil)
18 }
I get compiler error on line 16 for self.view and 17 for self.present(). Question is how do I provide view for the popup?
This code I used for another view (without table view or cell) as a test and it worked fine. So I'm trying do the same technique for a tableview/cell. How do I resolve this issue? Any help is appreciated.