• This repository has been archived on 27/Mar/2022
  • Stars
    star
    255
  • Rank 159,311 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A UIScrollView subclass with multiple layers and a parallax effect.

SWParallaxScrollView

A UIScrollView subclass with multiple layers and a parallax effect.

Build Status

Install

To use just add SWParallaxScrollView.h and SWParallaxScrollView.mm to your project or install via CocoaPods.

Add a pod entry to your Podfile:

pod 'SWParallaxScrollView', '~> 0.1.1'

Install the pod(s) by running:

pod install

Usage

Instantiate and configure SWParallaxScrollView like a regular UIScrollView. When adding subviews they get added on layer 0 by default and everything behaves like a regular scroll view. Subviews can also be added to a given layer:

[parallaxScrollView addSubview: someView onLayer: layer]

If the layer is less than zero those subviews will scroll slower than the regular scroll view. And if the layer is greater than 0 the subviews will scroll faster.

Demo

To run the demo open ParallaxScrollView.xcodeproj and run.

The graphics in the demo app are taken from Wikipedia user OhSqueezy. (Background, Middle Layer, Foreground)