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.
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
- Add SMParallaxMultiView in UICollectionViewCell, UITableViewCell, UIScrollView, etc.
@IBOutlet weak var paralaxView: SMParallaxMultiView!
- Set array of UIImage to SMParallaxMultiView:
paralaxView.images = dataSource[indexPath.row].images
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 |
- 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