Calling tableViewIndex.reloadData() the second time causes infinite loop in TableViewIndex's layoutSubviews()
4tuneTeller opened this issue · 2 comments
4tuneTeller commented
Everything works fine if I call the following code for the first time:
self.tableView.reloadData()
self.tableIndexController.tableViewIndex.reloadData()
but after I update data source of the table view, that code makes the app freeze because layoutSubviews() gets called infinitely in TableViewIndex. But I need to update the index view, what should I do?
4tuneTeller commented
I've spent some time debugging and it seems that it happens because of this line in the layoutSubviews() of the TableViewIndex class:
backgroundView.frame = layout.backgroundFrame
those are never equal which triggers the layoutSubviews() again every time.
4tuneTeller commented
Ok, so the problem occurred because I'm modifying the background frame myself too :)