5

iOS 16/Xcode 14 adds a blue border around cells in sidebar. How can this be removed?

My cell is a custom class derived from UICollectionViewListCell.

enter image description here

Phantom59
  • 947
  • 1
  • 8
  • 19

2 Answers2

3

allowsFocus is a new property in iOS 15. Its use is covered in this WWDC video: Build Desktop-class iPad app (see minute ~15:25). Perhaps the default (or the implementation) changed in iOS 16. In any case, setting it to false removes the border.

if #available(iOS 15.0, *) {
  collectionView.allowsFocus = false
}
Phantom59
  • 947
  • 1
  • 8
  • 19
3

To add to @Phantom59's answer. You can still use allowsFocus without the focus border by setting the UICollectionViewCell's focusEffect to nil:

if #available(iOS 15, *) {
    cell.focusEffect = nil
}

More info: Focus-based navigation

Wes
  • 161
  • 1
  • 6