UIView and UITableView, reloadData weird latency

后端 未结 2 2148
隐瞒了意图╮
隐瞒了意图╮ 2021-02-08 18:22

I have something weird with the repaint of my view controller. The view controller contains an UITableView and a spinner.

I have an updateFeed function

2条回答
  •  时光取名叫无心
    2021-02-08 18:59

    Here is my new answer for your editted question.

    I don't know exactly what happens because usually, the table view will reload data and redraw the table view in separate thread that will not run that slow. Here is some guess that you can check:

    1/ Check if you reuse the cell by cell identifier correctly

    2/ Check if any other data source and delegate methods do heavy, networking job like in

    * – tableView:cellForRowAtIndexPath:  required method
    * – numberOfSectionsInTableView:
    * – tableView:numberOfRowsInSection:  required method
    

    or in:

    #  – tableView:heightForRowAtIndexPath:
    # – tableView:indentationLevelForRowAtIndexPath:
    # – tableView:willDisplayCell:forRowAtIndexPath:
    

提交回复
热议问题