LoginSignup
0
1

More than 3 years have passed since last update.

tableView画面クラッシュ

Last updated at Posted at 2020-09-11

tableViewの画面がクラッシュする

【エラー】
Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.

【対応】
テーブルビューのリロード部分
self.rankingTableView.reloadData()

DispatchQueue.main.async {
self.rankingTableView.reloadData()
}

と囲むとクラッシュしなくなりました。

【参考】
swift初心者がiOS13対応でメインスレッド以外でUI更新をしてクラッシュさせてしまった話
https://qiita.com/rymiyamoto/items/7ace750172b84a2ff809

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1