CABasicAnimation *animationView = [CABasicAnimation animationWithKeyPath:@”transform”];
    self.view.layer.zPosition = 100;
    CATransform3D transform = CATransform3DMakeRotation(M_PI, 0, 1, 0);
    transform.m34 = 1.0/800.0;
    [animationView setToValue:[NSValue valueWithCATransform3D:transform]];
    [animationView setDuration:1.5];
    [animationView setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
    [animationView setFillMode:kCAFillModeBoth];
    [animationView setRemovedOnCompletion:YES];
    [animationView setDelegate:self];
    [self.view.layer addAnimation:animationView forKey:nil];

Enjoy Coding 🙂

Advertisements