GithubHelp home page GithubHelp logo

inamiy / yidragscrollbar Goto Github PK

View Code? Open in Web Editor NEW
37.0 5.0 4.0 275 KB

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

Objective-C 98.64% Ruby 1.36%

yidragscrollbar's Introduction

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.

yidragscrollbar's People

Contributors

inamiy avatar

Stargazers

sanghv avatar Vojtech Novak avatar Ryo Nakata avatar Erich Ocean avatar  avatar Jon Carr-Harris avatar Dan Huang avatar Wang Yandong avatar Laszlo Teveli avatar Naoki Fujii avatar  avatar  avatar Sarun Wongpatcharapakorn avatar John D. Pope avatar Simone Leopizzi avatar  avatar Gabriele Petronella avatar Pin Shih Wang avatar  avatar jprothwell avatar Andrew Shepard avatar Brian Michel avatar Martin Juhasz avatar Alexander Hramov avatar Ke avatar mayulu avatar Alberto Jerez avatar  avatar  avatar Andy Chentsov avatar Gilad Ronat avatar Romain Briche avatar Dave Smith avatar Indrajit Chakrabarty avatar  avatar Vinh Nguyen avatar Yosuke Ishikawa avatar

Watchers

 avatar mayulu avatar James Cloos avatar Valeriy Van avatar  avatar

yidragscrollbar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.