Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Anish-kumar-dev/SimpleMotionEffects

Open more actions menu
 
 

Repository files navigation

SimpleMotionEffects

This UIView Category provides a simpler API to create motion effects faster and in only a single line of code.

Screenshot

Installation

Cocoapods

pod 'SimpleMotionEffects'

Manually

Add the UIView+SimpleMotionEffects.{h,m} files to your project.

Usage

  1. Import the header #import "UIView+SimpleMotionEffects.h"
  2. Use any of the following methods on any UIView.

Just specify how much a view should move at maximum on both axes, when tilting:

- (void)addMotionEffectWithMovement:(CGPoint)movement;

Or specify, how much a view should move on both axes reacting to horizontalTilt oder verticalTilt only:

- (void)addMotionEffectOnHorizontalTilt:(CGPoint)horizontalMovement
                         onVerticalTilt:(CGPoint)verticalMovement;

Or for more granular settings:

- (void)addMotionEffectWithType:(UIInterpolatingMotionEffectType)type
                        keyPath:(NSString*)keyPath
                          value:(CGFloat)value;

- (void)addMotionEffectWithType:(UIInterpolatingMotionEffectType)type
                        keyPath:(NSString*)keyPath
                       minValue:(CGFloat)minValue
                       maxValue:(CGFloat)maxValue;

Twitter

I'm @jaydee3 on Twitter.

About

[iOS] Simply add UIView Motion Effects in a single line!

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.