Skip to content

Commit

Permalink
Merge pull request hyperoslo#389 from ulukaya/patch-2
Browse files Browse the repository at this point in the history
Fix accessibility labels
  • Loading branch information
zenangst authored Feb 20, 2018
2 parents ce33e9b + 1fa3765 commit 510f042
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/ImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ open class ImagePickerController: UIViewController {
initialContentOffset = galleryView.collectionView.contentOffset

applyOrientationTransforms()

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification,
bottomContainer);
}

open func resetAssets() {
Expand Down
6 changes: 6 additions & 0 deletions Source/TopView/TopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ open class TopView: UIView {
button.titleLabel?.font = self.configuration.flashButton
button.addTarget(self, action: #selector(flashButtonDidPress(_:)), for: .touchUpInside)
button.contentHorizontalAlignment = .left
button.accessibilityLabel = "Flash mode is auto"
button.accessibilityHint = "Double-tap to change flash mode"

return button
}()

open lazy var rotateCamera: UIButton = { [unowned self] in
let button = UIButton()
button.accessibilityLabel = ""
button.accessibilityHint = "Double-tap to rotate camera"
button.setImage(AssetManager.getImage("cameraIcon"), for: UIControlState())
button.addTarget(self, action: #selector(rotateCameraButtonDidPress(_:)), for: .touchUpInside)
button.imageView?.contentMode = .center
Expand Down Expand Up @@ -94,6 +98,7 @@ open class TopView: UIView {
case 1:
button.setTitleColor(UIColor(red: 0.98, green: 0.98, blue: 0.45, alpha: 1), for: UIControlState())
button.setTitleColor(UIColor(red: 0.52, green: 0.52, blue: 0.24, alpha: 1), for: .highlighted)

default:
button.setTitleColor(UIColor.white, for: UIControlState())
button.setTitleColor(UIColor.white, for: .highlighted)
Expand All @@ -103,6 +108,7 @@ open class TopView: UIView {

button.setImage(AssetManager.getImage(newTitle), for: UIControlState())
button.setTitle(newTitle, for: UIControlState())
button.accessibilityLabel = "Flash mode is \(newTitle)"

delegate?.flashButtonDidPress(newTitle)
}
Expand Down

0 comments on commit 510f042

Please sign in to comment.