1
[UIView animateWithDuration:0.5 animations:^{
    imageView.frame = self.view.bounds;

} completion:^(BOOL finished) {}];

how can I write this using CABasicanimation.

Sumi
  • 39
  • 1
  • 10

2 Answers2

2

below is the simple implementation

-(void)StartAnmation {
          [subview.layer addAnimation:[self ZoomAnimation] forKey:@"Zoom"];
}

-(CAAnimationGroup *)ZoomAnimation {
    CAAnimationGroup *ZoomAnimation = [CAAnimationGroup animation];
    CABasicAnimation *In = [self zoomIn];
    ZoomAnimation.animations = [NSArray arrayWithObjects: In, nil];
    ZoomAnimation.duration = 2.0f;
    return ZoomAnimation;
}

    -(CABasicAnimation *)zoomIn {
CABasicAnimation *ZoomInAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
        ZoomInAnimation.beginTime = 0.0f;
        ZoomInAnimation.fromValue = [NSNumber numberWithFloat:20.0];
        ZoomInAnimation.toValue = [NSNumber numberWithFloat:1.0];
        ZoomInAnimation.duration = 2.0f;
        return ZoomInAnimation;
    }
Shekhu
  • 1,998
  • 5
  • 23
  • 49
0

For Zoom images you can done by using UIImageView itself.

Please refer the answer Pinch To Zoom Effect on UIImageView inside scrollView

Community
  • 1
  • 1
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130