Tuesday, 7 April 2015

Swift, Do data processing on NonUI thread and update UI.




dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
...... do something to process your data dispatch_async(dispatch_get_main_queue(),{ self.tableView.reloadData() you must refresh UI here, because you already out of ui thread. })
})


No comments:

Post a comment