How to prevent UITableView from reuse custom cells Swift

前端 未结 4 1947
醉梦人生
醉梦人生 2021-01-02 05:43

In my App I use UITableView with custom cells.

for each cell I implement function to create it, and call these functions in cellFo

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 06:17

    Try to implement prepareForReuse method in your custom cell and set all fields text to nil.

    override func prepareForReuse() -> Void {
       awamirTextFieldNib.text = nil
    }
    

    Hope this help

提交回复
热议问题