From 4bed5fcf8bfdcf907d7bf2b00261e6b2d6bc3382 Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Sat, 21 Mar 2020 16:58:11 +0100 Subject: [PATCH] Fix background color during transition In Dark Mode the transition into a folder and back started and ended with a very noticeable white flicker. Now, the color will be updated before every transition. --- pass/Controllers/PasswordsViewController.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 5421454..4492c95 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -101,6 +101,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV transition.fillMode = CAMediaTimingFillMode.forwards transition.duration = 0.25 transition.subtype = CATransitionSubtype.fromRight + transition.delegate = self return transition }() @@ -111,6 +112,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV transition.fillMode = CAMediaTimingFillMode.forwards transition.duration = 0.25 transition.subtype = CATransitionSubtype.fromLeft + transition.delegate = self return transition }() @@ -675,8 +677,17 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV } extension PasswordsViewController: UISearchResultsUpdating { + func updateSearchResults(for searchController: UISearchController) { let scope = SearchBarScope(rawValue: searchController.searchBar.selectedScopeButtonIndex) ?? .all filterContentForSearchText(searchText: searchController.searchBar.text!, scope: scope) } } + +extension PasswordsViewController: CAAnimationDelegate { + + func animationDidStart(_ anim: CAAnimation) { + view.window?.backgroundColor = Colors.systemBackground + view.layer.backgroundColor = Colors.systemBackground.cgColor + } +}