Skip to content

Commit

Permalink
Modify safeReload in Presentables+UITableView to reload directly inst…
Browse files Browse the repository at this point in the history
…ead of dispatching to the main thread if it is already on the main thread.
  • Loading branch information
common authored and common committed Jun 26, 2019
1 parent b75664c commit 5804777
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ fileprivate extension Array where Element == UITableViewCell.Type {
extension UITableView: PresentableCollectionElement {

func safeReloadData() {
DispatchQueue.main.async {
self.reloadData()
if Thread.isMainThread {
reloadData()
} else {
DispatchQueue.main.async {
self.reloadData()
}
}
}

Expand Down

0 comments on commit 5804777

Please sign in to comment.