I'm presenting a modal view controller that has a background with a UIVisualEffectView
with an UIBlurEffect
of type .light
I'm presenting the modal view controller as below:
infoViewController.modalPresentationStyle = .overFullScreen
infoViewController.modalTransitionStyle = .crossDissolve
self.present(infoViewController, animated: true, completion: nil)
I'm noticing that the blur effect view does not appear until the crossDissolve
animation has completed.
This is not the case for other transition styles such as coverVertical
.
This is happening only on iOS 10 with Swift 3.
How can I get the crossDissolve
animation to work along with the visual effect view on my infoViewController
. Any suggestions/workarounds?
What I do is replacing the crossDisolve
with a CATransition
, like this:
self.present(controller,
animated: false,
completion: nil)
let transition = CATransition()
transition.duration = 0.3
transition.type = kCATransitionFade
view.window?.layer.add(transition, forKey: nil)
Hope it helps.
Check your consule, you should see there the reason -
<_UIPopoverBackgroundVisualEffectView 0x7fe053562840> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
You can't use the UIVisualEffectView
with crossDissolve
animation...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With