# Understanding UIViewPropertyAnimator's Presentation-State Behavior

DevFeed: [Understanding UIViewPropertyAnimator's Presentation-State Behavior](<https://devfeed.tech/articles/uiviewpropertyanimator-is-too-cute-32243.md>)

Original publisher: [Read original article](<https://publicobject.com/2025/01/26/uiviewpropertyanimator/>)

Author: Jesse Wilson

Published: 2025-01-26T21:04:55Z

Content type: article

Language: en

Sources: [Public Object](<https://devfeed.tech/sources/public-object.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [animation](<https://devfeed.tech/tags/animation.md>), [code](<https://devfeed.tech/tags/code.md>), [effect](<https://devfeed.tech/tags/effect.md>), [swift](<https://devfeed.tech/tags/swift.md>)

## AI overview

This article investigates how UIViewPropertyAnimator animates a UIButton's alpha in Swift. It observes that the animated visual state can differ from the property value, that changing some properties during animation may take effect after completion, and that only certain properties animate as expected. An update explains that CALayer.presentation() exposes properties during an animation.

## Source excerpt

I was using the old UIView APIs when I found some code that broke my brain. Here's Swift code to animates a UIButton from opaque to transparent over one second. let button = ... let animateOut = UIViewPropertyAnimator(duration: 1.0, curve: .easeInOut) { print("2 alpha=\(button.alpha)") button.alpha = 0.0