Coder Social home page Coder Social logo

priteshrnandgaonkar / tglparallaxcarousel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from taglia3/tglparallaxcarousel

0.0 3.0 0.0 4.17 MB

A lightweight 3D Linear Carousel with parallax effect

License: MIT License

Ruby 2.79% Objective-C 2.78% Shell 47.98% Swift 46.44%

tglparallaxcarousel's Introduction

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
}
  1. 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("")
}
}
  1. Enjoy!

Author

taglia3, [email protected]

LinkedIn, Matteo Tagliafico

License

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

tglparallaxcarousel's People

Contributors

mtagliafico avatar taglia3 avatar hemant3370 avatar

Watchers

James Cloos avatar Pritesh Nandgaonkar avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.