forked from shadowfacts/Tusker
Disable selection of presenting sidebar items on focus
This commit is contained in:
parent
4f2f8d517f
commit
230bd50661
|
@ -448,6 +448,20 @@ extension MainSidebarViewController: UICollectionViewDelegate {
|
|||
sidebarDelegate?.sidebar(self, didSelectItem: item)
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 15.0, *)
|
||||
func collectionView(_ collectionView: UICollectionView, selectionFollowsFocusForItemAt indexPath: IndexPath) -> Bool {
|
||||
guard let item = dataSource.itemIdentifier(for: indexPath) else {
|
||||
return true
|
||||
}
|
||||
// don't immediately select items that present VCs when the they're focused, only when deliberately selected
|
||||
switch item {
|
||||
case .tab(.compose), .addList, .addSavedHashtag, .addSavedInstance:
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension MainSidebarViewController: UICollectionViewDragDelegate {
|
||||
|
|
Loading…
Reference in New Issue