Giter Club home page Giter Club logo

sectionscrubber's Introduction

SectionScrubber

Version Carthage compatible platforms License

  • The scrubber will move along when scrolling the UICollectionView it has been added to.
  • When you pan the scrubber you 'scrub' over the UICollectionView.
  • While scrubbing you can choose the title that will be shown in the scrubber.

Usage

From your UICollectionViewController:

lazy var sectionScrubber: SectionScrubber = {
    let scrubber = SectionScrubber(collectionView: self.collectionView)
    scrubber.sectionlabelTextColor = UIColor(red: 69/255, green: 67/255, blue: 76/255, alpha: 0.8)
    scrubber.dataSource = self

    return scrubber
}()

override func viewDidLoad() {
    super.viewDidLoad()
    self.collectionView?.addSubview(sectionScrubber)
}

override func scrollViewDidScroll(scrollView: UIScrollView) {
    self.sectionScrubber.updateScrubberPosition()
}

override func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) {
    self.sectionScrubber.updateScrubberPosition()
}

extension RemoteCollectionController: SectionScrubberDataSource {
    func sectionScrubber(sectionScrubber: SectionScrubber, titleForSectionAt indexPath: NSIndexPath) -> String {
        return Photo.title(index: indexPath.section)
    }
}

Installation

SectionScrubber is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SectionScrubber'

SectionScrubber is also available through Carthage. To install it, simply add the following line to your Cartfile:

github "bakkenbaeck/SectionScrubber"

License

SectionScrubber is available under the MIT license. See the LICENSE file for more info.

Author

Bakken & Bæck, @bakkenbaeck

sectionscrubber's People

Contributors

3lvis avatar marijnschilling avatar nselvis avatar zenangst avatar elland avatar ramongilabert avatar timkurvers avatar askeland avatar jgorset avatar kostiakoval avatar

Watchers

James Cloos avatar

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.