I want to access some cell values outside of cellForRowAt.
@IBAction func ShareClicked(_ sender: UIButton) -> Void {
print("Hello Edit Button")
let indexPath = IndexPath(row: 0, section: 0)
let cell = TableView.cellForRow(at: indexPath) as! ProfileTableViewCell
let activityVC = UIActivityViewController(activityItems: [cell.Books!, "I found this book", cell.Title!,"in the LitSwap app for :",cell.Price! ], applicationActivities: nil)
activityVC.popoverPresentationController?.sourceView = self.view
self.present(activityVC, animated: true, completion: nil)
}
I want to access cell.Books, cell.Title and cell.Price in a button function. However, with my solution above, I want to be able to capture any row in my tableViewCell and not just (row: 0, section: 0) but I am not sure how to do that.