UIView and UITableView, reloadData weird latency

后端 未结 2 732
走了就别回头了
走了就别回头了 2021-02-08 18:54

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 19:20

    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:
    

提交回复
热议问题