TGLParallaxCarousel

by taglia3

A lightweight 3D Linear Carousel with parallax effect

434 Stars 65 Forks Last release: about 4 years ago (0.3) MIT License 16 Commits 4 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

TGLParallaxCarousel

CI Status Version License Platform

A lightweight 3D Linear Carousel with parallax effect

[GIF] Threedimensional & Normal mode

Threedimensional demo Normal demo

Installation

TGLParallaxCarousel is available through CocoaPods. To install it, simply add the following line to your Podfile:

Swift 3:

pod 'TGLParallaxCarousel'

Swift 2.2:

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.

@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

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, Matteo Tagliafico

License

TGLParallaxCarousel is available under the MIT license. See the LICENSE file for more info.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.