GithubHelp home page GithubHelp logo

ios-scrollbar's Introduction

ios-ScrollBar

ScrollBar it is the fast way to scroll through the scroll views, for example table view or collection view. And it has a small hint view with a text.

Demo

Installation

Just copy the ios-ScrollBar/ScrollBar.swift source file to your project. Or contact me if you want to install it through CocoaPods or Carthage, I'll make it happen :) Just open an issue.

Usage

  • Create an instance passing a scroll view. ScrollBar retains the scroll view, but don't worry until you don't passing self in the init :)
self.scrollBar = ScrollBar(scrollView: tableView)
scrollBar.dataSource = self
  • Add conformance of ScrollBarDataSource to your dataSource. All methods are optional and have default implementation, so you can easily check it out in action
/// A control view which you drag to scroll. Default is simple grey circle
func view(for scrollBar: ScrollBar) -> UIView
/// Distance between the control view and the right screen edge. Default 30pt
func rightOffset(for scrollBarView: UIView, for scrollBar: ScrollBar) -> CGFloat
/// Position of the hint view by X coordinate. Default is the middle of the scroll view's bounds
func hintViewCenterXCoordinate(for scrollBar: ScrollBar) -> CGFloat
/// A text describing current point in the scroll view. If `nil` the hint view is hidden
func textForHintView(_ hintView: UIView, at point: CGPoint, for scrollBar: ScrollBar) -> String?

Example

You can try to scroll in the demo project ios-ScrollBar.xcodeproj

Requirements

Swift 4.2 iOS 10.3+

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.