Skip to content

VRGsoftUA/SMParallaxView

Repository files navigation

SMParallaxView

UIView container which applies parallax effect to its content. You can Even achieve 3d effect if you use two containers, one atop another like on video below.

Usage

This view works only in UIScrollView (like UICollectionView, UITableView etc). Its also possible to achieve parallax scrolling in two directions simultaneously (of course, if your parent scrollView supports bi-directional scrolling) For a working implementation, Have a look at the Sample

  1. Add SMParallaxMultiView in UICollectionViewCell, UITableViewCell, UIScrollView, etc.
@IBOutlet weak var paralaxView: SMParallaxMultiView!
  1. Set array of UIImage to SMParallaxMultiView:
paralaxView.images = dataSource[indexPath.row].images

Customization

Attribute Description
isEnabledHorizontalParallax Enables or disables horizontal parallax effect
isEnabledVerticaleParallax Same as isEnabledHorizontalParallax but vertical
isInvertedHorizontalParallax If true direction of the parallax effect will be opposite to scroll direction
isInvertedVerticaleParallax Same as isInvertedHorizontalParallax but vertical
isNeedScaleContainerView Defines whether scale need to be applied
parallaxScale Scale value applied to the whole ParallaxView. Default is 1.5. Do nothing if isNeedScaleContainerView set to false

Contributing

  • Contributions are always welcome
  • If you want a feature and can code, feel free to fork and add the change yourself and make a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages