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...
MijickPopups Hero

  Popups Alerts Resizable Sheets Banners

SwiftUI Tooltip

This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...

SimpleToast for SwiftUI

SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...

SSToastMessage

Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...

ToastUI

A simple way to show toast in SwiftUI   Getting Started • Documentation • Change Log