UIView.transition and setting `.isHidden` property is broken in iOS 12

Originator:fxm90.radar
Number:rdar://46753872 Date Originated:12/15/2018
Status:Open Resolved:
Product:iOS Product Version:12.0+
Classification: Reproducible:Yes
 
Using the method `UIView.transition(with:duration:options:animations:completion:)` and updating the property `isHidden` was working fine until iOS 12. Starting at version 12, only fading in the specific view is working correctly. Setting the property to `true` immediately hides the given view, ignoring the animation duration.

Steps to Reproduce:
```
let view = UIView()

// Layout view etc...

UIView.transition(with: view,
                       duration: 1.0,
                        options: [.transitionCrossDissolve],
                  animations: {
                         self.gradientView.isHidden = true
})
```

Expected Results:
Expected view to fade out in 1 second.

Actual Results:
View is hidden immediately.

Version/Build:
iOS 12

Comments

See also:

  • https://stackoverflow.com/questions/52355841/how-to-fade-out-a-titleview-label-on-ios-12

  • https://forums.raywenderlich.com/t/uiview-transition-by-setting-ishidden-property-broken-in-ios-12/45615

By fxm90.radar at Dec. 15, 2018, 1:54 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!