SectionScrubber
A component to quickly scroll between collection view sections
Install / Use
/learn @3lvis/SectionScrubberREADME
SectionScrubber
- The scrubber will move along when scrolling the
UICollectionViewit 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
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
