Reputation: 697
What is the logically executed order of a UITableViewController's methods when a segue is performed to show the tableView? Here is my best guess:
viewWillLayoutSubviews
numberOfSectionsInTableView
numberOfRowsInSection
cellForRowAtIndexPath
heightForRowAtIndexPath
viewDidLoad
viewWillAppear
viewDidAppear
Please correct this ordering and add to it.
Upvotes: 5
Views: 3073
Reputation: 4078
If you have 1 row and 1 section. This is the pattern it goes through.
Upvotes: 8
Reputation: 1420
This may help you.
viewDidLoad
As it loads view first.
viewWillAppear
As any view appears again then this method is called.
numberOfSectionsInTableView
Sets number of sections in a table.
numberOfRowsInSection
After setting sections,this method determines number of rows in a section.
heightForRowAtIndexPath
Height for row will be set.
viewWillLayoutSubviews
View for section header is made.
cellForRowAtIndexPath
Contents and layout of cell of a tableview is created in this method.
viewDidAppear
Upvotes: 10