Home > Enterprise >  What is the difference between adding UITableView delegate and datasource through storyboard and pro
What is the difference between adding UITableView delegate and datasource through storyboard and pro

Time:07-26

We can add UITableView delegate and datasource to UIViewController via storyboard and programmatically, so i want to know that is there any difference in app performance using one of this methods.

CodePudding user response:

No there is not any difference in terms of app performance. It is just a matter of preference.

CodePudding user response:

Of course a UITableView has only one and the same delegate and dataSource property.

So the difference is what sets them: your code or the iOS code that instantiates a storyboard. Execution of both is similar in performance.

But a storyboard is a textual file that needs to be processed at run-time before the iOS code to set the properties will be executed. When you set these table properties in the storyboard, this adds a little processing work.

Since iOS is very fast at processing storyboards, the additional time for these two table properties is negligible.

You should therefore not worry about performance and just do what you'd prefer.

  • Related