From 1650951d53c576b83b4e8e0125d8f35e25779dd6 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 5 Nov 2019 18:08:11 -0800 Subject: [PATCH] Fixes AppViewController navigation bar appearing upon app becoming active --- AltStore/App Detail/AppViewController.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AltStore/App Detail/AppViewController.swift b/AltStore/App Detail/AppViewController.swift index b79852a8..238dbe9c 100644 --- a/AltStore/App Detail/AppViewController.swift +++ b/AltStore/App Detail/AppViewController.swift @@ -107,6 +107,7 @@ class AppViewController: UIViewController NotificationCenter.default.addObserver(self, selector: #selector(AppViewController.didChangeApp(_:)), name: .NSManagedObjectContextObjectsDidChange, object: DatabaseManager.shared.viewContext) NotificationCenter.default.addObserver(self, selector: #selector(AppViewController.willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(AppViewController.didBecomeActive(_:)), name: UIApplication.didBecomeActiveNotification, object: nil) self._backgroundBlurEffect = self.backgroundBlurView.effect as? UIBlurEffect self._backgroundBlurTintColor = self.backgroundBlurView.contentView.backgroundColor @@ -540,6 +541,15 @@ private extension AppViewController self._shouldResetLayout = true self.view.setNeedsLayout() } + + @objc func didBecomeActive(_ notification: Notification) + { + guard let navigationController = self.navigationController, navigationController.topViewController == self else { return } + + // Fixes Navigation Bar appearing after app becomes inactive -> active again. + self._shouldResetLayout = true + self.view.setNeedsLayout() + } } extension AppViewController: UIScrollViewDelegate