This library gives you a carousel of buttons to be used in your projects.
This CarouselButtons library helps you to have a carousel of buttons.
- Add icon and title for your button.
- Choose the initial state.
- Add action when the buttton is selected.
- Xcode 12.x
- Swift 5.x
You can use CocoaPods to install CarouselButtons
by adding it to your Podfile
:
platform :ios, '15.0'
use_frameworks!
pod 'CarouselButtons', :git => 'https://github.com/TeloTechnology/CarouselButtons.git', :tag => '1.0.2'
To get the full benefits import CarouselButtons
.
import CarouselButtons
- Download and drop
CarouselButtons
folder in your project. - Congratulations!
-
Set the height to 126px via code or GUI.
-
Add the code below.
@IBOutlet
private weak var carouselCollectionButton: CarouselCollectionView!
let data = [
(title: "Cash", icon: UIImage(named: "CashMoney"), isAvailable: true),
(title: "Credit Card", icon: UIImage(named: "CreditCard"), isAvailable: true),
(title: "Wallet 1", icon: UIImage(named: "Wallet"), isAvailable: false),
(title: "Wallet 2", icon: UIImage(named: "Wallet"), isAvailable: true)
]
carouselCollectionButton.add(data)
carouselCollectionButton.didSelectButton = { position in
print("Did select at: \(position) with title: \(data[position].title")
}
Check the demo project.
We would love you for the contribution to CarouselButtons, please create a Pull Request.
Rudi Luis – @Linkedin
Telo Technology Limited – @Website