I have a tableview with custom cells with dynamic cell heights depending on the cell content.
My problem is the following, when I ask, programmatically, in the viewD
As so far i came to know that,
All the operations used to before the view
is shown on the screen are initialized in the viewDidLoad
all the UI objects, data objects can be allocated and initialized in this method.
All the operations data modifications, UI modifications made to view
need to be done in viewDidAppear
. Or even some operations can be done in viewWillAppear
.
So for your issue, the UITableView
scrolling must be done after the table is loaded on & shown on screen i.e., in viewDidAppear
.
Also note that viewDidAppear
& viewWillAppear
will be called each time view is shown to user, so if you want to scroll the table only for the first instance you can have a flag in your header indicating the instance.