gpt4 book ai didi

ios - 捕获 cellForRowAt 之外的单元格值

转载 作者:行者123 更新时间:2023-11-28 08:07:50 25 4
gpt4 key购买 nike

<分区>

我想访问 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)

}

我想在按钮函数中访问 c​​ell.Books、cell.Title 和 cell.Price。但是,通过上面的解决方案,我希望能够捕获 tableViewCell 中的任何行,而不仅仅是 (row: 0, section: 0),但我不确定该怎么做。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com