Latest 1.2.0
Homepage https://github.com/inamiy/YIDragScrollBar
License Beerware If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.
Platforms ios 5.0, requires ARC
Dependencies JRSwizzle
Frameworks QuartzCore
Authors

YIDragScrollBar 1.2.0

Attaches draggable scroll bar on top of original UIScrollView for iOS5+, works like a drug.

ScreenShot1

  • YIDragScrollBar uses JRSwizzle to extend UIScrollView‘s functionality, and does not use any private APIs.
  • Installed UIScrollView subclass will add another dragging-scrollIndicator on top of it and temporarily hides original-scrollIndicator while dragging.
  • Several application tests have been passed including:
    • vertical/horizontal dragging
    • zooming
    • device rotation
    • indicatorStyle (black & white)
    • contentInsets/scrollIndicatorInsets
    • UIScrollView subclasses (e.g. UITableView, UIWebView, UITextView)
    • never intercepts touches while original-scrollIndicator is hidden

Install via CocoaPods

pod 'YIDragScrollBar'

How to use

Just import the files, and all set!

#import "YIDragScrollBar.h"

...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // set NO to disable dragScrollBar on each scrollView-init. defalut = YES.
    // [UIScrollView setDefaultDragScrollBarEnabled:NO];

    return YES;
}

Set scrollView.dragScrollBarDelegate to detect dragScrollBar began/ended.


- (void)viewDidLoad
{
    ...

    self.scrollView.dragScrollBarDelegate = self;
}

- (void)dragScrollBarWillBeginDragging:(UIScrollView *)scrollView
{
    NSLog(@"dragScrollBar began");
}

- (void)dragScrollBarWillEndDragging:(UIScrollView *)scrollView
{
    NSLog(@"dragScrollBar ended");
}

License

YIDragScrollBar is available under the Beerware license.

If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

Latest podspec

{
    "name": "YIDragScrollBar",
    "version": "1.2.0",
    "license": {
        "type": "Beerware",
        "text": "If we meet some day, and you think this stuff is worth it, you can buy me a beer in return."
    },
    "homepage": "https://github.com/inamiy/YIDragScrollBar",
    "authors": {
        "Yasuhiro Inami": "[email protected]"
    },
    "summary": "Attaches draggable scroll bar on top of original UIScrollView for iOS5+, works like a drug.",
    "screenshots": [
        "https://raw.github.com/inamiy/YIDragScrollBar/master/Screenshots/screenshot1.png"
    ],
    "source": {
        "git": "https://github.com/inamiy/YIDragScrollBar.git",
        "tag": "1.2.0"
    },
    "source_files": "Classes/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "5.0"
    },
    "frameworks": "QuartzCore",
    "dependencies": {
        "JRSwizzle": [
            "~> 1.0"
        ]
    }
}

Pin It on Pinterest

Share This