From 61fde3100d98d66a3e5b5c3f4efb973e4048a402 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Mon, 9 Sep 2019 01:22:24 +0400 Subject: [PATCH] Fix blur animations on older systems --- submodules/ContextUI/Sources/ContextController.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/submodules/ContextUI/Sources/ContextController.swift b/submodules/ContextUI/Sources/ContextController.swift index 9f27b28a6f..daf36b26f7 100644 --- a/submodules/ContextUI/Sources/ContextController.swift +++ b/submodules/ContextUI/Sources/ContextController.swift @@ -366,8 +366,10 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi }) } } else { + self.effectView.effect = makeCustomZoomBlurEffect() + self.effectView.alpha = 0.0 UIView.animate(withDuration: 0.2 * animationDurationFactor, animations: { - self.effectView.effect = makeCustomZoomBlurEffect() + self.effectView.alpha = 1.0 }, completion: { [weak self] _ in self?.didCompleteAnimationIn = true }) @@ -478,11 +480,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi self.effectView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.05 * animationDurationFactor, delay: 0.15, timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue, removeOnCompletion: false) } else { UIView.animate(withDuration: 0.21 * animationDurationFactor, animations: { - if #available(iOS 9.0, *) { - self.effectView.effect = nil - } else { - self.effectView.alpha = 0.0 - } + self.effectView.alpha = 0.0 }, completion: { _ in completedEffect = true intermediateCompletion()