Skip to content

A tiny category on UIView that allows you to set one property: "parallaxIntensity" to achieve a parallax effect with UIMotionEffect

License

Notifications You must be signed in to change notification settings

michaeljbishop/NGAParallaxMotion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NGAParallaxMotion

A tiny category on UIView that allows you to set one property: parallaxIntensity to achieve a parallax effect with UIMotionEffect.

Show the parallax effect in one line

theView.parallaxIntensity = 10;

Positive values make the view appear to extend from the screen. Negative values make the view appear to recess behind the screen.

Interface Builder

Additionally, you can set this property within Interface Builder by editing the "User Defined Runtime Attributes" and adding:

KeyPath           |  Type  | Value
----------------------------------------------
parallaxIntensity | Number |  your depth value

Interface Builder

Examples

On

Off

License

This code is under the MIT license.

Release Notes

1.1

  • Added new direction constraints (Thanks @arunaharsa!)

1.0

  • Initial Release

About

A tiny category on UIView that allows you to set one property: "parallaxIntensity" to achieve a parallax effect with UIMotionEffect

Resources

License

Stars

Watchers

Forks

Packages

No packages published