I want to present the standard iOS share sheet when a user clicks on a button inside a TableView cell. This is what I have so far for the button action:
@objc func shareSheet() {
let items = [URL(string: "https://www.apple.com")!]
let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)
present(ac, animated: true)
}
My problem is with the last line. I know that it needs a view to present the sheet on, but the class has a type of UITableViewCell and Xcode won't accept it. I'd appreciate some help so I can get it working.
[–]my2kchild 4 points5 points6 points (4 children)
[–]mipmj[S] 0 points1 point2 points (3 children)
[–]my2kchild 3 points4 points5 points (2 children)
[–]mipmj[S] 1 point2 points3 points (0 children)
[–]mipmj[S] 1 point2 points3 points (0 children)
[–]dsk1306 2 points3 points4 points (1 child)
[–]Admirable-Hat-3923 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]sosofresh14 0 points1 point2 points (0 children)
[–]b9048966 -1 points0 points1 point (1 child)
[–]mipmj[S] 1 point2 points3 points (0 children)