diff --git a/Tusker/Screens/Main/MainTabBarViewController.swift b/Tusker/Screens/Main/MainTabBarViewController.swift index ec4cb40b89..57808a2b94 100644 --- a/Tusker/Screens/Main/MainTabBarViewController.swift +++ b/Tusker/Screens/Main/MainTabBarViewController.swift @@ -45,7 +45,9 @@ class MainTabBarViewController: BaseMainTabBarViewController { embedInNavigationController(Tab.myProfile.createViewController(mastodonController)), ] + #if !os(visionOS) setupFastAccountSwitcher() + #endif tabBar.isSpringLoaded = true diff --git a/Tusker/Screens/Main/NewMainTabBarViewController.swift b/Tusker/Screens/Main/NewMainTabBarViewController.swift index 10124a4fa6..633e1f7244 100644 --- a/Tusker/Screens/Main/NewMainTabBarViewController.swift +++ b/Tusker/Screens/Main/NewMainTabBarViewController.swift @@ -91,7 +91,7 @@ final class NewMainTabBarViewController: BaseMainTabBarViewController { ] reloadSavedInstances() - if UIDevice.current.userInterfaceIdiom == .phone { + if UIDevice.current.userInterfaceIdiom == .phone || UIDevice.current.userInterfaceIdiom == .vision { self.tabs = [ homeTab, notificationsTab, @@ -121,7 +121,9 @@ final class NewMainTabBarViewController: BaseMainTabBarViewController { NotificationCenter.default.addObserver(self, selector: #selector(reloadSavedInstances), name: .savedInstancesChanged, object: nil) } + #if !os(visionOS) setupFastAccountSwitcher() + #endif } private func updatePadTabs() { @@ -312,7 +314,9 @@ final class NewMainTabBarViewController: BaseMainTabBarViewController { } @objc private func sidebarTapped() { + #if !os(visionOS) fastAccountSwitcher?.hide() + #endif } private func showAddList() { @@ -500,6 +504,9 @@ extension NewMainTabBarViewController: UITabBarController.Sidebar.Delegate { config.imageProperties.maximumSize = CGSize(width: MainSidebarMyProfileCollectionViewCell.avatarImageSize, height: MainSidebarMyProfileCollectionViewCell.avatarImageSize) config.imageProperties.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * MainSidebarMyProfileCollectionViewCell.avatarImageSize + #if os(visionOS) + item.contentConfiguration = config + #else if UIDevice.current.userInterfaceIdiom != .mac { item.accessories = [ .customView(configuration: .init(customView: fastAccountSwitcherIndicator, placement: .trailing())) @@ -510,6 +517,7 @@ extension NewMainTabBarViewController: UITabBarController.Sidebar.Delegate { } else { item.contentConfiguration = config } + #endif } return item }