Skip to content

Instantly share code, notes, and snippets.

@Athosone
Created January 3, 2016 17:39
Show Gist options
  • Save Athosone/efafde2f3b5edd75d4e8 to your computer and use it in GitHub Desktop.
Save Athosone/efafde2f3b5edd75d4e8 to your computer and use it in GitHub Desktop.
//
// Animations.h
// thirsty
//
// Created by Werck Ayrton on 02/06/2015.
// Copyright (c) 2015 Nyu Web Developpement. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <POP/POP.h>
#import <UIKit/UIKit.h>
@interface Animations : NSObject
+ (void) addShakingAnimation:(UIView*)destView;
@end
//Animation.m
//
// Animations.m
// thirsty
//
// Created by Werck Ayrton on 02/06/2015.
// Copyright (c) 2015 Nyu Web Developpement. All rights reserved.
//
#import "Animations.h"
@implementation Animations
+ (void) addShakingAnimation:(UIView*)destView
{
POPSpringAnimation *shake = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
shake.springBounciness = 20;
shake.velocity = @(2500);
[destView.layer pop_addAnimation:shake forKey:@"shakeView"];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment