Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taglia3/TGLParallaxCarousel
A lightweight 3D Linear Carousel with parallax effect
https://github.com/taglia3/TGLParallaxCarousel
Last synced: 6 days ago
JSON representation
A lightweight 3D Linear Carousel with parallax effect
- Host: GitHub
- URL: https://github.com/taglia3/TGLParallaxCarousel
- Owner: taglia3
- License: mit
- Created: 2016-04-03T14:08:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-04T07:22:38.000Z (over 1 year ago)
- Last Synced: 2024-11-05T06:22:26.136Z (about 1 month ago)
- Language: Shell
- Size: 4.07 MB
- Stars: 435
- Watchers: 10
- Forks: 63
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - TGLParallaxCarousel - A lightweight 3D Linear Carousel with parallax effect. (Media / Image)
- awesome-ios-star - TGLParallaxCarousel - A lightweight 3D Linear Carousel with parallax effect. (Media / Image)
README
# TGLParallaxCarousel
[![CI Status](http://img.shields.io/travis/taglia3/TGLParallaxCarousel.svg?style=flat)](https://travis-ci.org/taglia3/TGLParallaxCarousel)
[![Version](https://img.shields.io/cocoapods/v/TGLParallaxCarousel.svg?style=flat)](http://cocoapods.org/pods/TGLParallaxCarousel)
[![License](https://img.shields.io/cocoapods/l/TGLParallaxCarousel.svg?style=flat)](http://cocoapods.org/pods/TGLParallaxCarousel)
[![Platform](https://img.shields.io/cocoapods/p/TGLParallaxCarousel.svg?style=flat)](http://cocoapods.org/pods/TGLParallaxCarousel)A lightweight 3D Linear Carousel with parallax effect
### [GIF] Threedimensional & Normal mode
![Threedimensional demo](https://raw.githubusercontent.com/taglia3/ParallaxCarousel/master/gif/Threedimensional.gif) ![Normal demo](https://raw.githubusercontent.com/taglia3/ParallaxCarousel/master/gif/Normal.gif)
## Installation
TGLParallaxCarousel is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:Swift 3:
```ruby
pod 'TGLParallaxCarousel'
```Swift 2.2:
```ruby
pod 'TGLParallaxCarousel' ', '~> 0.3'
```## Usage
1) Place one UIView object in your VC in the Storyboard and set it as subclass of `TGLParallaxCarousel`
2) Create an IBOutlet in your VC.swift file, connect it a connect delegate and datasource.
```swift
@IBOutlet weak var carouselView: TGLParallaxCarousel!
override func viewDidLoad() {
super.viewDidLoad()carouselView.delegate = self
carouselView.margin = 10
carouselView.selectedIndex = 2
carouselView.type = .threeDimensional
}
```3) Conform to delegate
```swift
extension ViewController: TGLParallaxCarouselDelegate {func numberOfItemsInCarouselView(_ carouselView: TGLParallaxCarousel) -> Int {
return 5
}func carouselView(_ carouselView: TGLParallaxCarousel, itemForRowAtIndex index: Int) -> TGLParallaxCarouselItem {
return CustomView(frame: CGRect(x: 0, y: 0, width: 300, height: 150) , number: index)
}func carouselView(_ carouselView: TGLParallaxCarousel, didSelectItemAtIndex index: Int) {
print("Tap on item at index \(index)")
}func carouselView(_ carouselView: TGLParallaxCarousel, willDisplayItem item: TGLParallaxCarouselItem, forIndex index: Int) {
print("")
}
}
```4) Enjoy!
## Author
taglia3, [email protected]
[LinkedIn](https://www.linkedin.com/in/matteo-tagliafico-ba6985a3), Matteo Tagliafico
## License
TGLParallaxCarousel is available under the MIT license. See the LICENSE file for more info.