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