UITableViewを使用している時、テーブルの最上部に戻したい時が多くある。
そんな時は下記のようにscrollToRowAtIndexPath
を用いる。
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: false)
More than 5 years have passed since last update.
UITableViewを使用している時、テーブルの最上部に戻したい時が多くある。
そんな時は下記のようにscrollToRowAtIndexPath
を用いる。
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: false)
Register as a new user and use Qiita more conveniently