LoginSignup
0
1

More than 3 years have passed since last update.

UITableViewCellのreload時のアニメーションを防ぐ

Last updated at Posted at 2020-01-18

実装方法

Sample.swift
UIView.performWithoutAnimation {
    tableView.reloadRows(at: [indexPath], with: .automatic)
}

注意点

stackoverflow等ではreloadRowsの引数に.noneを指定している例が多いですが、noneは「デフォルトのアニメーションを使用する」オプションなので間違えないでください。
.noneを指定すると、リロード時にCell内のViewやラベルが点滅することがありました。

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