An easy-configuring UIView + UIImageView to perform parallax effect.
- Xcode 5 or higher
- Apple LLVM compiler
- iOS 6.0 or higher
- ARC
Build and run JMEParallaxViewExample
Xcode workspace to see how JMEParallaxView
works.
parallaxView.observingScrollView = tableView;
parallaxView.contentImageView.image = yourImage;
parallaxView.contentDisplayingPercentage = 0.8;
parallaxView.activeRange = [JMEParallaxView activeRangeWithTableView:tableView indexPath:indexPath direction:parallaxView.direction edgeInsets:UIEdgeInsetsZero];
See more in the example project.
JMEParallaxView is available through CocoaPods, to install it simply add the following line to your Podfile:
pod "JMEParallaxView"
Alternatively, you can manually copy the files under JMEParallaxView
directory into your project. Just be sure to have KVOController in your project, since we use it to track your scroll view.
Jo-Yuan Hsieh
JMEParallaxView very gratefully makes use of these other fantastic open source projects:
- KVOController - Used to track scrolling events of UIScrollView.
Demo photos kindly provided by Jo-Yuan Hsieh (http://instagram.com/jmehsieh).
JMEParallaxView is available under the MIT license. See the LICENSE file for more info.