How to reach the current selected cell in didSelectRowAtIndexPath?

前端 未结 6 1664
迷失自我
迷失自我 2021-02-01 00:10

I want to change the accessory view type of a cell through the method: didSelectRowAtIndexPath , i.e. when a row is selected I want to change the accessory view type, can I do t

6条回答
  •  粉色の甜心
    2021-02-01 01:04

    Swift

    You can get the cell from didSelectRowAtIndexPath: method using the indexPath like this:

     let cell:UITableViewCell? = tableView.cellForRowAtIndexPath(indexPath)
    

提交回复
热议问题