Skip to content

Commit

Permalink
Merge branch 'master' into feature/accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Barreto authored Mar 28, 2018
2 parents d0b0d76 + a974e6b commit 04212ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Sources/ButtonBarPagerTabStripViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa
changeCurrentIndex(currentIndex == indexPath.item ? nil : cell, currentIndex == indexPath.item ? cell : nil, false)
}
}
cell.isAccessibilityElement = true
cell.accessibilityLabel = cell.label.text
cell.accessibilityTraits |= UIAccessibilityTraitButton
cell.accessibilityTraits |= UIAccessibilityTraitHeader
return cell
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/PagerTabStripViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
guard !viewControllers.isEmpty else {
fatalError("viewControllers(for:) should provide at least one child view controller")
}
viewControllers.forEach { if !($0 is IndicatorInfoProvider) { fatalError("Every view controller provided by PagerTabStripDataSource's viewControllers(for:) method must conform to InfoProvider") }}
viewControllers.forEach { if !($0 is IndicatorInfoProvider) { fatalError("Every view controller provided by PagerTabStripDataSource's viewControllers(for:) method must conform to IndicatorInfoProvider") }}

}

Expand Down
3 changes: 2 additions & 1 deletion Sources/SegmentedPagerTabStripViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ open class SegmentedPagerTabStripViewController: PagerTabStripViewController, Pa

open override func viewDidLoad() {
super.viewDidLoad()
segmentedControl = segmentedControl ?? UISegmentedControl()
let auxSegmentedControl = segmentedControl ?? UISegmentedControl()
segmentedControl = auxSegmentedControl
if segmentedControl.superview == nil {
navigationItem.titleView = segmentedControl
}
Expand Down

0 comments on commit 04212ea

Please sign in to comment.