Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inamiy/yidragscrollbar
Attaches draggable scroll bar on top of original UIScrollView for iOS5+, works like a drug.
https://github.com/inamiy/yidragscrollbar
Last synced: 29 days ago
JSON representation
Attaches draggable scroll bar on top of original UIScrollView for iOS5+, works like a drug.
- Host: GitHub
- URL: https://github.com/inamiy/yidragscrollbar
- Owner: inamiy
- Created: 2013-04-13T07:18:42.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-02T06:50:17.000Z (over 10 years ago)
- Last Synced: 2024-09-21T12:02:31.950Z (about 2 months ago)
- Language: Objective-C
- Size: 269 KB
- Stars: 37
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
YIDragScrollBar 1.2.0
=====================Attaches draggable scroll bar on top of original UIScrollView for iOS5+, works like a drug.
- `YIDragScrollBar` uses [JRSwizzle](https://github.com/rentzsch/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 hiddenInstall via [CocoaPods](http://cocoapods.org/)
----------```
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](http://en.wikipedia.org/wiki/Beerware) license.If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.