This may depend on the level and configuration of the view, but substantially
viewToOpen.layer.anchorPoint = CGPointMake(1.0f, 0.5f); CATransform3D endTransform = CATransform3DMakeRotation(-M_PI/2.0f,0.0f,1.0f,0.0f)
The full code will look like this:
self.layer.anchorPoint = CGPointMake(1.0f, 0.5f); self.layer.position = CGPointMake(self.layer.position.x + self.bounds.size.width/2.0f, self.layer.position.y); CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; animation.duration = 0.75f; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; CATransform3D tfm = CATransform3DMakeRotation(M_PI/2.0f, 0.0f, -1.0f, 0.0f); tfm.m34 = 0.001f; tfm.m14 = -0.0015f; animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity]; animation.toValue = [NSValue valueWithCATransform3D:tfm]; [self.layer addAnimation:animation forKey:@"flipUp"];
source share