MPParallaxView

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

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.

Posted

in

,

by

Tags:

Comments

Leave a Reply