我的桌面视图单元格内有一个按钮。如何转换以下代码行,以便在点击按钮(而不是行)时执行相同的功能?提前致谢。在表格视图单元内单击按钮时执行功能
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath){
// Get Cell Label
let indexPath = tableView.indexPathForSelectedRow!
let currentCell = tableView.cellForRowAtIndexPath(indexPath) as! PostCell
if currentCell.updateBtn.hidden == false {
valuetoPass = currentCell.favorTitle.text
valuetoPass_desc = currentCell.descriptionText.text
postKey = currentCell.post.postKey
performSegueWithIdentifier("seguetoVC", sender: self)
}
if currentCell.bidBtn.hidden == false {
bidInt = currentCell.post.bids
postKey = currentCell.post.postKey
passUsername = currentCell.post.username
performSegueWithIdentifier("seguetoBidVC", sender: self)
}
}
u能放的cellForRowAtIndexPath的代码? –