Expand cell when tapped in Swift

后端 未结 5 1095
南方客
南方客 2020-12-13 01:14

I have been trying to implement a feature in my app so that when a user taps a cell in my table view, the cell expands downwards to reveal notes. I have found plenty of exam

5条回答
  •  既然无缘
    2020-12-13 01:30

    After getting the index path in didSelectRowAtIndexPath just reload the cell with following method reloadCellsAtIndexpath and in heightForRowAtIndexPathMethod check following condition

    if selectedIndexPath != nil && selectedIndexPath == indexPath {    
           return yourExpandedCellHieght
    }
    

提交回复
热议问题