From 51f9f421b89249e7986f93506aaf79b265288db3 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 25 Nov 2024 21:19:21 -0500 Subject: [PATCH] Fix hang when using switching accounts on iPadOS 18 Closes #550 --- .../Screens/Main/NewMainTabBarViewController.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tusker/Screens/Main/NewMainTabBarViewController.swift b/Tusker/Screens/Main/NewMainTabBarViewController.swift index 6d989ddc..98912492 100644 --- a/Tusker/Screens/Main/NewMainTabBarViewController.swift +++ b/Tusker/Screens/Main/NewMainTabBarViewController.swift @@ -33,6 +33,13 @@ final class NewMainTabBarViewController: BaseMainTabBarViewController { private var isCompact: Bool? @Box fileprivate var myProfileCell: UIView? private var sidebarTapRecognizer: UITapGestureRecognizer? + + private lazy var fastAccountSwitcherIndicator: UIView = { + let indicator = FastAccountSwitcherIndicatorView() + // need to explicitly set the frame to get it vertically centered + indicator.frame = CGRect(origin: .zero, size: indicator.intrinsicContentSize) + return indicator + }() override func viewDidLoad() { super.viewDidLoad() @@ -513,13 +520,6 @@ extension NewMainTabBarViewController: UITabBarControllerDelegate { } } -private var fastAccountSwitcherIndicator: UIView = { - let indicator = FastAccountSwitcherIndicatorView() - // need to explicitly set the frame to get it vertically centered - indicator.frame = CGRect(origin: .zero, size: indicator.intrinsicContentSize) - return indicator -}() - @available(iOS 18.0, *) extension NewMainTabBarViewController: UITabBarController.Sidebar.Delegate { func tabBarController(_ tabBarController: UITabBarController, sidebarVisibilityWillChange sidebar: UITabBarController.Sidebar, animator: any UITabBarController.Sidebar.Animating) {