LoginSignup
1
1

More than 5 years have passed since last update.

UITableViewの最上部に移動するスニペット

Last updated at Posted at 2016-08-04

UITableViewを使用している時、テーブルの最上部に戻したい時が多くある。
そんな時は下記のようにscrollToRowAtIndexPathを用いる。

let indexPath = NSIndexPath(forRow: 0, inSection: 0)
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: false)
1
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
1
1