diff --git a/Signal/src/ViewControllers/LoadingViewController.swift b/Signal/src/ViewControllers/LoadingViewController.swift index 52d5d1281..172d8ed49 100644 --- a/Signal/src/ViewControllers/LoadingViewController.swift +++ b/Signal/src/ViewControllers/LoadingViewController.swift @@ -50,7 +50,7 @@ public class LoadingViewController: UIViewController { var isShowingTopLabel = false var isShowingBottomLabel = false - override public func viewDidAppear(_ animated: Bool) { + override public func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // We only show the "loading" UI if it's a slow launch. Otherwise this ViewController diff --git a/Signal/src/util/OWSScreenLockUI.m b/Signal/src/util/OWSScreenLockUI.m index 8f92c49a9..9e09b4915 100644 --- a/Signal/src/util/OWSScreenLockUI.m +++ b/Signal/src/util/OWSScreenLockUI.m @@ -130,8 +130,9 @@ NS_ASSUME_NONNULL_BEGIN [self observeNotifications]; - // Default to screen protection until we know otherwise. - [self updateScreenBlockingWindow:ScreenLockUIStateScreenProtection animated:NO]; + // Hide the screen blocking window until "app is ready" to + // avoid blocking the loading view. + [self updateScreenBlockingWindow:ScreenLockUIStateNone animated:NO]; // Initialize the screen lock state. // diff --git a/SignalMessaging/ViewControllers/ScreenLockViewController.m b/SignalMessaging/ViewControllers/ScreenLockViewController.m index cf2a961fb..958ee2cc3 100644 --- a/SignalMessaging/ViewControllers/ScreenLockViewController.m +++ b/SignalMessaging/ViewControllers/ScreenLockViewController.m @@ -76,6 +76,8 @@ NSString *NSStringForScreenLockUIState(ScreenLockUIState value) self.screenBlockingImageView = imageView; self.screenBlockingButton = button; + + [self updateUIWithState:ScreenLockUIStateScreenProtection isLogoAtTop:NO animated:NO]; } // The "screen blocking" window has three possible states: @@ -89,6 +91,10 @@ NSString *NSStringForScreenLockUIState(ScreenLockUIState value) { OWSAssertIsOnMainThread(); + if (!self.isViewLoaded) { + return; + } + BOOL shouldShowBlockWindow = uiState != ScreenLockUIStateNone; BOOL shouldHaveScreenLock = uiState == ScreenLockUIStateScreenLock;