//
//  SlideInLeftAnimation.m
//  Pods
//
//  Created by titengjiang on 16/2/29.
//
//

#import "SlideInLeftAnimation.h"

@implementation SlideInLeftAnimation


-(void)prepare
{
    
    NSArray<NSNumber *> *keyTimes =  @[@0,@1];
    
    CAKeyframeAnimation * transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
    transformAnimation.keyTimes = keyTimes;
    
    CATransform3D startTransform = CATransform3DTranslate(_targetView.layer.transform, -  ViewWidth(_targetView),0, 0);
    
    transformAnimation.values = @[[NSValue valueWithCATransform3D:startTransform],
                                  [NSValue valueWithCATransform3D:_targetView.layer.transform]
                                  ];
    
    _animationGroup.animations = @[transformAnimation];
    _animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
    
}


@end
// 鐗堟潈灞炰簬鍘熶綔鑰?// http://code4app.com (cn) http://code4app.net (en)
// 鍙戝竷浠g爜浜庢渶涓撲笟鐨勬簮鐮佸垎浜綉绔? Code4App.com