Skip to content

Commit 04212ea

Browse files
author
Martin Barreto
authored
Merge branch 'master' into feature/accessibility
2 parents d0b0d76 + a974e6b commit 04212ea

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Sources/ButtonBarPagerTabStripViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa
347347
changeCurrentIndex(currentIndex == indexPath.item ? nil : cell, currentIndex == indexPath.item ? cell : nil, false)
348348
}
349349
}
350+
cell.isAccessibilityElement = true
351+
cell.accessibilityLabel = cell.label.text
352+
cell.accessibilityTraits |= UIAccessibilityTraitButton
353+
cell.accessibilityTraits |= UIAccessibilityTraitHeader
350354
return cell
351355
}
352356

Sources/PagerTabStripViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
381381
guard !viewControllers.isEmpty else {
382382
fatalError("viewControllers(for:) should provide at least one child view controller")
383383
}
384-
viewControllers.forEach { if !($0 is IndicatorInfoProvider) { fatalError("Every view controller provided by PagerTabStripDataSource's viewControllers(for:) method must conform to InfoProvider") }}
384+
viewControllers.forEach { if !($0 is IndicatorInfoProvider) { fatalError("Every view controller provided by PagerTabStripDataSource's viewControllers(for:) method must conform to IndicatorInfoProvider") }}
385385

386386
}
387387

Sources/SegmentedPagerTabStripViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ open class SegmentedPagerTabStripViewController: PagerTabStripViewController, Pa
5757

5858
open override func viewDidLoad() {
5959
super.viewDidLoad()
60-
segmentedControl = segmentedControl ?? UISegmentedControl()
60+
let auxSegmentedControl = segmentedControl ?? UISegmentedControl()
61+
segmentedControl = auxSegmentedControl
6162
if segmentedControl.superview == nil {
6263
navigationItem.titleView = segmentedControl
6364
}

0 commit comments

Comments
 (0)