This commit is contained in:
Stuart Breckenridge committed 2026-01-30 05:48:33 +08:00
1 parent 1bc74848c8
commit d22f37b131
2 files changed
+10 -3

No files matched your search

@@ -33,6 +33,8 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab
}
}
private static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "MainFeedCollectionViewController")
private let keyboardManager = KeyboardManager(type: .sidebar)
override var keyCommands: [UIKeyCommand]? {
@@ -98,16 +100,21 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
Self.logger.debug("MainFeedCollectionViewController: viewDidAppear")
/// On iPhone, once the deselection animation has completed, set `isAnimating`
/// to false and this will allow selection.
if traitCollection.userInterfaceIdiom == .phone {
if traitCollection.userInterfaceIdiom == .phone && UIDevice.current.orientation == .portrait {
if collectionView.indexPathsForSelectedItems != nil {
coordinator.selectSidebarItem(indexPath: nil, animations: [.select])
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
self.isAnimating = false
})
}
return
} else if traitCollection.userInterfaceIdiom == .phone && UIDevice.current.orientation.isLandscape {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
self.isAnimating = false
})
}
}
@@ -216,7 +216,7 @@ final class MainTimelineModernViewController: UIViewController, UndoableCommandR
self.navigationController?.navigationBar.alpha = 1
}
}
if traitCollection.userInterfaceIdiom == .phone {
if traitCollection.userInterfaceIdiom == .phone && UIDevice.current.orientation.isPortrait {
if coordinator?.currentArticle != nil {
if let indexPath = collectionView?.indexPathsForSelectedItems?.first {
collectionView?.deselectItem(at: indexPath, animated: true)