ToosieSlide
`ToosieSlide` is simple `Swift` library to generate a carousel like effect.
Install / Use
/learn @TheInkedEngineer/ToosieSlideREADME
ToosieSlide
ToosieSlide is a library that offers a custom flow layout that simulates a paginated collection view, with the cell always staying in the middle. In other words, a carousel.
In addtion ToosieSlide supports automatic cell resizing and alpha difference between focused and unfocused cells.
ToosieSlide is fully documented here
Unless you have been living under a rock or born in 2030, ToosieSlide gets its name and its logo is inspired by Drake's Toosie Slide
Here is what it looks like:
<img src="ToosieSlideDemo.gif" alt="Toosie Slide Demo" height="300">1. Requirements and Compatibility
- iOS 10+
- XCode 11
- Swift 5.1+
2. Installation
Cocoapods
Add the following line to your Podfile
pod 'ToosieSlide', '~> 1.1'
Swift Package Manager
Add the following to you Package.swift
dependencies: [
.package(url: "https://github.com/TheInkedEngineer/ToosieSlide.git", .upToNextMajor(from: "1.1.1"))
]
3. Code Example
Using UICollectionViewCarouselLayout
lazy var collection: UICollectionView = {
let carouselFlow = UICollectionViewCarouselLayout()
carouselFlow.itemSize = CGSize(width: DemoCell.width, height: DemoCell.height)
carouselFlow.minimumLineSpacing = 10
let collection = UICollectionView(collectionViewCarouselLayout: carouselFlow)
collection.register(DemoCell.self, forCellWithReuseIdentifier: DemoCell.identifier)
return collection
}()
Customizing UICollectionViewCarouselLayout
let carouselFlow = UICollectionViewCarouselLayout()
carouselfFlow.lowestVelocitySensitivity = 0.3
carouselfFlow.focusedItemScaleFactor = 1
carouselfFlow.focusedItemAlphaValue = 1
carouselfFlow.nonFocusedItemsScaleFactor = 0.5
carouselfFlow.nonFocusedItemsAlphaValue = 0.7
4. Roadmap
- support continuous swiping
5. Contribution
Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub
Generate the project
To generate this project locally, you need xcodegen. It is a great tool to customize a project and generate it on the go.
You can either install it manually following their steps, or just run my setup.sh script. It automatically installs Homebrew if it is missing, installs xcodegen, removes existing (if present) .xcodeproj, run xcodegen and moves configuratiom files to their appropriate place.
Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.4kCreate 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
341.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.4kCommit, push, and open a PR
