Sandip Pawar
Sandip Pawar

Reputation: 1

SQLite Database fetching on other than main UI thread

On tableview show lot of data from sqlite database with multiple mapping table.On tableview cell show average data from mapping table with mapping table average sum.That calculation part is need to done on other than UI thread and if calculated then reload on tableview cell like leasy loading.Please help me for that task how to perform.

Upvotes: 0

Views: 222

Answers (1)

Austin Michael
Austin Michael

Reputation: 490

This might help,

DispatchQueue.global(qos: .background).async {
    //Do your calculation here
}

DispatchQueue.main.async {
   //Reload Tableview here
}

Upvotes: 1

Related Questions