diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2023-09-20 16:29:53 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2023-09-22 15:17:29 +0200 |
| commit | b85f1b2b4aac6aa433c898330c2f933ea99e0d9d (patch) | |
| tree | e3fc3a484c04f00ca1d7c3e6d0f53687d47dd759 /ios | |
| parent | ab04534123f1dab6c7807d63a4c98fcbda2a24b6 (diff) | |
| download | mullvadvpn-b85f1b2b4aac6aa433c898330c2f933ea99e0d9d.tar.xz mullvadvpn-b85f1b2b4aac6aa433c898330c2f933ea99e0d9d.zip | |
Improve notification banner transitions
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/Notifications/UI/NotificationController.swift | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/ios/MullvadVPN/Notifications/UI/NotificationController.swift b/ios/MullvadVPN/Notifications/UI/NotificationController.swift index 14c133433b..b29e3d2bae 100644 --- a/ios/MullvadVPN/Notifications/UI/NotificationController.swift +++ b/ios/MullvadVPN/Notifications/UI/NotificationController.swift @@ -12,7 +12,6 @@ final class NotificationController: UIViewController { let bannerView: NotificationBannerView = { let bannerView = NotificationBannerView() bannerView.translatesAutoresizingMaskIntoConstraints = false - bannerView.isHidden = true bannerView.isAccessibilityElement = true return bannerView }() @@ -63,7 +62,6 @@ final class NotificationController: UIViewController { // avoid undesired horizontal expansion animation. view.layoutIfNeeded() - bannerView.isHidden = false hideBannerConstraint?.isActive = false showBannerConstraint?.isActive = true } else { @@ -71,13 +69,6 @@ final class NotificationController: UIViewController { hideBannerConstraint?.isActive = true } - let finish = { [weak self] in - if self?.lastNotification == nil { - self?.bannerView.isHidden = true - } - completion?() - } - if animated { let timing = UISpringTimingParameters( dampingRatio: 0.7, @@ -89,12 +80,12 @@ final class NotificationController: UIViewController { self.view.layoutIfNeeded() } animator.addCompletion { _ in - finish() + completion?() } animator.startAnimation() } else { view.layoutIfNeeded() - finish() + completion?() } } |
