SectionScrubber

A component to quickly scroll between collection view sections

  • Owner: 3lvis/SectionScrubber
  • Platform:
  • License:: Other
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Main metrics

Overview
Name With Owner3lvis/SectionScrubber
Primary LanguageSwift
Program languageRuby (Language Count: 3)
Platform
License:Other
所有者活动
Created At2016-05-02 09:30:24
Pushed At2020-10-06 20:24:06
Last Commit At2020-10-06 22:24:01
Release Count12
Last Release Name1.1.1 (Posted on )
First Release Name0.1.0 (Posted on )
用户参与
Stargazers Count188
Watchers Count17
Fork Count15
Commits Count377
Has Issues Enabled
Issues Count17
Issue Open Count0
Pull Requests Count32
Pull Requests Open Count0
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private