Latest 0.0.2
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit


a UIScrollView category for making a scroll to top button via runtime


  • use cocoapods
    pod 'UIScrollView+ScrollToTopBtn', '~> 0.0.1'
  • manual import
    just download lib folder and add into your project


  • customization for scrollToTop button, you can custom its image态title态backgroundImage or other properties as usually
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:@"top"] forState:UIControlStateNormal];
    //    [btn setTitle:@"go" forState:UIControlStateNormal];
    //    [btn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
  • custom some properties
    // frame for scrollToTop button, include the origin position and size. default size: 44.f(side length) and its margin 12.f
    self.tableView.scrollToTopBtnFrame = CGRectMake(self.view.bounds.size.width - 100, self.view.bounds.size.height - 100, 100, 100);

// offset for show/hidden the scrollToTop button, default value:[UIScreen mainScreen].bounds.size.height
self.tableView.scrollToTopBtnShowOffset = 700.f;

- set for your UIScrollView / UITableView / UICollectionView / UIWebView or other views which is subClass of UIScrollView
self.tableView.scrollToTopBtn = btn;
  • done & enjoy it



Release notes

  • 0.0.1

first commit

Latest podspec

    "name": "UIScrollView+ScrollToTopBtn",
    "version": "0.0.2",
    "summary": "a UIScrollView category for making a scroll to top button",
    "description": "a UIScrollView category for making a scroll to top button via runtime",
    "homepage": "",
    "license": {
        "type": "MIT"
    "authors": {
        "litt1e-p": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.2"
    "platforms": {
        "ios": "7.0"
    "requires_arc": true,
    "source_files": "UIScrollView+ScrollToTopBtn/*",
    "frameworks": [

Pin It on Pinterest

Share This