Ios CGAffineTransformMakeScale先入后出动画不起作用

Ios CGAffineTransformMakeScale先入后出动画不起作用,ios,objective-c,animation,core-animation,uiviewanimation,Ios,Objective C,Animation,Core Animation,Uiviewanimation,我正在尝试在视图中设置动画,然后在稍后设置动画。我的代码如下所示 - (void) animateIn{ self.contentView.alpha = 0.0; self.contentView.transform = CGAffineTransformMakeScale(0.1, 0.1); [UIView animateWithDuration:0.4 delay:0.0 usingSpringWithDamping:0.6 initialSpringVeloci

我正在尝试在视图中设置动画,然后在稍后设置动画。我的代码如下所示

- (void) animateIn{
    self.contentView.alpha = 0.0;
    self.contentView.transform = CGAffineTransformMakeScale(0.1, 0.1);
    [UIView animateWithDuration:0.4 delay:0.0 usingSpringWithDamping:0.6 initialSpringVelocity:0.0 options:0 animations:^{
        self.contentView.alpha = 1.0;
        self.contentView.transform = CGAffineTransformIdentity;
    } completion:nil];
}

- (void) animateOut{
    [UIView animateWithDuration:0.4 animations:^{
        self.contentView.alpha = 0.0;
        self.contentView.transform = CGAffineTransformMakeScale(0.1, 0.1);
    }];
}
动画效果很好。动画不显示。动画看起来像是视图增长得非常快


知道我做错了什么吗?

在animateOut中,应该省略前两行:self.contentView.alpha=1.0;self.contentView.transform=CGAffineTransformity;这并没有改变任何事情。但为了保持简单,我将从示例中删除它。是的,我知道它不会改变任何东西。这是一个评论,不是对你问题的回答。