MPParallaxView
  • September 16, 2023

Apple TV Parallax effect in Swift. Rotate view using touch or accelerometer.

Usage


To run the example project, clone the repo, and run pod install from the Example directory first.

Want to quickly look at demo? Type pod try MPParallaxView!

Parallax effect


You can easily customize Parallax View in Storyboard! Jump into Example project to look at properties.

How about accelerometer parallax instead of touch? Set Accelerometer Enabled to On in Storyboard.

There are 3 different ways to set up parallax:

  • .basedOnHierarchyInParallaxView – views in background moves less than views in foreground. You can increase the movement by changing multiplerOfIndexInHierarchyToParallaxOffset – this value will be multiplied by index of view in hierarchy. Default.
  • .basedOnTag – set a tag for a view. For instance, snowflakes image view has 13 tag which means noticeable movement. On the other hand, top view with cast members has 1 tag – almost no movement.
  • .custom(Int) – provide your custom value.

Requirements


Xcode 8, iOS 9

Installation


MPParallaxView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod “MPParallaxView”

GitHub


View Github

#ios #swift
YOU MIGHT ALSO LIKE...
ACarousel

A carousel view for SwiftUI

Sparklines for macOS, iOS and tvOS

A lightweight sparkline component, supporting Swift, SwiftUI, macCatalyst and Objective-C.     What is a sparkline? A sparkline is a very ...

Light Chart

LightChart is a lightweight SwiftUI package with line charts implementation. You can use it when you need only a chart that will perfectly ...

SwiftUICharts

Swift package for displaying charts effortlessly. V2 Beta is here 🎉🎉🎉 V2 focuses on providing a strong and easy to ...

SwiftUI BarChart

Lightweight and easy to use SwiftUI chart library for all Apple platforms