Compare commits

...

4 Commits

6 changed files with 44 additions and 9 deletions

View File

@ -1,5 +1,13 @@
# Changelog
## 2024.4 (134)
Features/Improvements:
- iOS 18: New floating sidebar/tab bar
Bugfixes:
- Fix crash when hashtag search results include duplicates
- Fix "no content" text not being removed from list timeline after refreshing
## 2024.3 (133)
- Add additional info to Tip Jar

View File

@ -45,7 +45,9 @@ class MainTabBarViewController: BaseMainTabBarViewController {
embedInNavigationController(Tab.myProfile.createViewController(mastodonController)),
]
#if !os(visionOS)
setupFastAccountSwitcher()
#endif
tabBar.isSpringLoaded = true

View File

@ -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
}

View File

@ -7,7 +7,7 @@
//
import UIKit
import Combine
import TuskerPreferences
@available(iOS 17.0, *)
class AdaptableNavigationController: UIViewController {
@ -15,6 +15,7 @@ class AdaptableNavigationController: UIViewController {
private let viewControllersToPrependInCompact: [UIViewController]
private var initialViewControllers: [UIViewController] = []
private var currentWidescreenNavigationMode: WidescreenNavigationMode?
private lazy var regular = makeRegularNavigationController()
private lazy var compact = makeCompactNavigationController()
private var _current: (any NavigationControllerProtocol)?
@ -39,6 +40,8 @@ class AdaptableNavigationController: UIViewController {
registerForTraitChanges([UITraitHorizontalSizeClass.self]) { (self: AdaptableNavigationController, previousTraitCollection) in
self.updateNavigationController()
}
NotificationCenter.default.addObserver(self, selector: #selector(preferencesChanged), name: .preferencesChanged, object: nil)
}
private func updateNavigationController() {
@ -47,6 +50,7 @@ class AdaptableNavigationController: UIViewController {
if let _current {
_current.removeViewAndController()
stack = _current.viewControllers
_current.viewControllers = []
isTransferring = true
} else {
stack = initialViewControllers
@ -79,6 +83,7 @@ class AdaptableNavigationController: UIViewController {
private func makeRegularNavigationController() -> any NavigationControllerProtocol {
// TODO: need to figure out how to update the navigation controller if the pref changes
self.currentWidescreenNavigationMode = Preferences.shared.widescreenNavigationMode
switch Preferences.shared.widescreenNavigationMode {
case .stack:
return EnhancedNavigationViewController()
@ -92,6 +97,18 @@ class AdaptableNavigationController: UIViewController {
private func makeCompactNavigationController() -> any NavigationControllerProtocol {
EnhancedNavigationViewController()
}
@objc private func preferencesChanged() {
if currentWidescreenNavigationMode != Preferences.shared.widescreenNavigationMode {
if let _current,
_current === regular {
regular = makeRegularNavigationController()
updateNavigationController()
} else {
regular = makeRegularNavigationController()
}
}
}
}
@available(iOS 17.0, *)

View File

@ -87,7 +87,7 @@ class SplitNavigationController: UIViewController {
NSLayoutConstraint.activate([
rootNav.view.topAnchor.constraint(equalTo: view.topAnchor),
rootNav.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
rootNav.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
rootNav.view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
separatorView.topAnchor.constraint(equalTo: view.topAnchor),
separatorView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
@ -196,13 +196,13 @@ class SplitNavigationController: UIViewController {
NSLayoutConstraint.deactivate(constraints)
if visible {
constraints = [
rootNav.view.trailingAnchor.constraint(equalTo: view.centerXAnchor),
secondaryNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
secondaryNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
]
} else {
constraints = [
rootNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
secondaryNav.view.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.5),
rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
secondaryNav.view.widthAnchor.constraint(equalTo: rootNav.view.widthAnchor),
]
}
NSLayoutConstraint.activate(constraints)

View File

@ -9,8 +9,8 @@
// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
MARKETING_VERSION = 2024.3
CURRENT_PROJECT_VERSION = 133
MARKETING_VERSION = 2024.4
CURRENT_PROJECT_VERSION = 134
CURRENT_PROJECT_VERSION = $(inherited)$(CURRENT_PROJECT_VERSION_BUILD_SUFFIX_$(CONFIGURATION))
CURRENT_PROJECT_VERSION_BUILD_SUFFIX_Debug=-dev