Latest 0.2.1
Homepage https://github.com/taglia3/TGLParallaxCarousel
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

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:

pod "TGLParallaxCarousel"

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.datasource = self
carouselView.itemMargin = 10
}

// MARK: TGLParallaxCarousel datasource

func numberOfItemsInCarousel(carousel: TGLParallaxCarousel) ->Int {
return 5
}

func viewForItemAtIndex(index: Int, carousel: TGLParallaxCarousel) -> TGLParallaxCarouselItem {
return CustomView(frame: CGRectMake(0, 0, 300, 150), number: "(index + 1)")
}

3) Set the datasource. Each item must be subclass of TGLParallaxCarouselItem


func numberOfItemsInCarousel(carousel: TGLParallaxCarousel) ->Int {
return 5
}

func viewForItemAtIndex(index: Int, carousel: TGLParallaxCarousel) -> TGLParallaxCarouselItem {
return CustomView(frame: CGRectMake(0, 0, 300, 150), number: "(index + 1)")
}

4) Listen to delegate


func didTapOnItemAtIndex(index: Int, carousel: TGLParallaxCarousel) {
print("Tap on item at index (index)")
}

func didMovetoPageAtIndex(index: Int) {
print("Did move to index (index)")
}

5) Enjoy!

Author

taglia3, [email protected]

License

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

Latest podspec

{
    "name": "TGLParallaxCarousel",
    "version": "0.2.1",
    "summary": "A lightweight 3D Linear Carousel with parallax effect.",
    "description": "A lightweight 3D Linear Carousel with parallax effect. Use this custom View to create beatiful effects.",
    "homepage": "https://github.com/taglia3/TGLParallaxCarousel",
    "license": "MIT",
    "authors": {
        "taglia3": "[email protected]"
    },
    "source": {
        "git": "https://github.com/taglia3/TGLParallaxCarousel.git",
        "tag": "0.2.1"
    },
    "social_media_url": "https://twitter.com/taglia3",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "TGLParallaxCarousel/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This