Circular UIView scale animation goes back to square sometimes
<p>I put a UIView on center of the screen with Autolayout. This UIView is a square sized to be 15% of screen width. Then on my controller I add the cornerRadius :</p>

<pre><code>override func viewDidLayoutSubviews() {
    circle.layer.cornerRadius = circle.frame.size.width / 2.0
}
</code></pre>

<p>Then when user click on a button, the circular view is scaling down with a first animation.</p>

<pre><code>UIView.animateWithDuration(0.4, delay: 0.1, options: .CurveEaseIn, animations: { () -&gt; Void in
    self.circle.alpha = 0.0
    self.circle.transform = CGAffineTransformMakeScale(0.01, 0.01)
}) { (finished) -&gt; Void in
    scaleUp()
}

private func scaleUp() {
    UIView.animateWithDuration(0.5, delay: 0.0, options: .CurveEaseInOut, animations: { () -&gt; Void in
        self.circle.alpha = 1.0
        self.circle.transform = CGAffineTransformIdentity
    }) { (finished) -&gt; Void in

    }
}
</code></pre>

<p>Sometimes the scale down animation doesn't work properly. Before starting the cornerRadius is removed and my UIView become a square. But sometimes my animation works well and the circle scale down animation is OK.</p>

<p>Moreover the scale up animation seems to work well all the time.</p>

<p>I don't understand why the scale down animation isn't working all the time.</p>

<p>Any idea?</p>

<p>Thanks</p>