Il mio codice è al di sotto, ma l'animazione appena avviene istantaneamente vale a dire la vista non è più visibile:Problema animando con CATransform3DRotate
UIView *leftDoorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width /2, self.view.bounds.size.height)];
leftDoorView.backgroundColor = [UIColor greenColor];
leftDoorView.layer.anchorPoint = CGPointMake(0.0, 0.5);
[self.view addSubview:leftDoorView];
leftDoorView.center = CGPointMake(0.0, self.view.bounds.size.height/2.0); //compensate for anchor offset
CATransform3D transform = CATransform3DIdentity;
transform.m34 = -1.0f/500.0;
transform = CATransform3DRotate(transform, M_PI_2, 0, 1, 0);
[UIView animateWithDuration:1.0 animations:^{
leftDoorView.layer.transform = transform;
}];
Non so cosa sto facendo male - ogni aiuto sarebbe apprezzato per favore.
Ho appena copiato il codice in viewDidAppear: di un'app e mostra correttamente l'animazione. –