[Solved] Swift populate UITableView before App is loaded


You cannot access and populate any view before it is loaded, and it does so only once the whole application has been loaded. A UITableView is a subclass of UIView, so the same applies in this case.

“I want to do this because when tab with TableView is clicked first time -> Data loading takes about 1-2 sec.”

If you retrieve your data from an external online database, you can load your data when the app launches, inside:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool 

And later you can pass your data to your table view in any effective way, such that it only takes time to pass the data, and not to retrieve it. But all this depends on what kind and what amount of data you are retrieving.

solved Swift populate UITableView before App is loaded