SectionScrubber
  • October 10, 2023
  • 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”

GitHub


View Github

#carthage #cocoapods #ios #sectionscrubber #swift #uicollectionview
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...