简体   繁体   中英

Change slelected cell of UITableView with Swift

嗨,我有UITableViewUITableViewCell类,当用户单击单元格的单元格更改标题时,我要如何在Swift中做到这一点?

Implement

self.tableView.delegate = self

//

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

    let cell = tableView.cellForRow(at:indexPath) as! CellClassName

    cell.titleLbl = //////  suppose here the outlet is titleLbl

    // reflect this to model array to avoid reusing issues when you scroll
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM