I have a UIVisualEffectView created in IB and a property
@IBOutlet weak var visualEffectStack: UIVisualEffectView!
I can show and hide the visual effect view using
visualEffectStack.isHidden = false
visualEffectStack.isHidden = true
or using alpha.
I want to animate appearance of the view, but it does not animate.
visualEffectStack.alpha = 0
visualEffectStack.isHidden = false
UIView.animate(withDuration: 0.5, delay: 0.5, options: [.curveEaseIn, .beginFromCurrentState], animations: {
self.visualEffectStack.alpha = 1
})
Is there a problem in my code or is it the visual effect view?
Swift 3.1 and iOS 10
not animating
. you should considered changing youranimation duration
to higher value(duration
ordelay
0.5 is too quick if you using above code in viewDidLoad). – Joe