Skip to content

Commit

Permalink
Merge pull request #604 from rechsteiner/fix-accessibility-traits
Browse files Browse the repository at this point in the history
Add availability check for accessibility traits
  • Loading branch information
rechsteiner authored Oct 16, 2021
2 parents 9bc191a + dae81f1 commit ced9145
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Parchment/Classes/PagingTitleCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ open class PagingTitleCell: PagingCell {
open func configureAccessibility() {
accessibilityIdentifier = viewModel?.title
contentView.accessibilityLabel = viewModel?.title
contentView.accessibilityTraits = viewModel?.selected ?? false ? [.tabBar, .selected] : .tabBar
if #available(iOS 10.0, *) {
contentView.accessibilityTraits = viewModel?.selected ?? false ? [.tabBar, .selected] : .tabBar
} else {
contentView.accessibilityTraits = viewModel?.selected ?? false ? .selected : .none
}
}

open override func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) {
Expand Down

0 comments on commit ced9145

Please sign in to comment.