LoginSignup
1
1

More than 5 years have passed since last update.

UIViewController+UITableViewの組み合わせでstatusbarをタップして最上部までスクロールした時にUIRefreshControlが動作しないようにする方法

Posted at

タイトル長すぎですね。。。

UIViewController+UITableView+UIRefreshControlの組み合わせでstatusbarをタップして最上部までスクロールすると、UIRefreshControlが動作もしくは表示されることがあります。

そんな時は以下のコードを書いておくと回避できます。

func scrollViewShouldScrollToTop(scrollView: UIScrollView) -> Bool {
    self.tableView.scrollToRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0), atScrollPosition: UITableViewScrollPosition.Top, animated: true)
    return true
}

これは魔法ですので、理由は聞かないでください。。。

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