Manos Chorianopoulos

TelcoViewController accessibilities

......@@ -130,6 +130,8 @@ import SwiftEventBus
moreTextView.isScrollEnabled = false
toggleMore()
setupAccessibilty()
}
public override func viewWillAppear(_ animated: Bool) {
......@@ -141,6 +143,22 @@ import SwiftEventBus
}
// MARK: - Functions
func setupAccessibilty() {
heroImage.isAccessibilityElement = true
heroImage.accessibilityLabel = "Φωτογραφία εκπτωτικού κουπονιού"
heroImage.accessibilityTraits = .image
activateButton.isAccessibilityElement = true
activateButton.accessibilityLabel = activateButton.title(for: .normal)
activateButton.accessibilityHint = "Διπλό πάτημα για άνοιγμα"
activateButton.accessibilityTraits = .button
moreButton.isAccessibilityElement = true
moreButton.accessibilityLabel = moreButton.title(for: .normal)
moreButton.accessibilityHint = "Διπλό πάτημα για εμφάνιση"
moreButton.accessibilityTraits = .button
moreButton.accessibilityValue = "Συμπτυγμένο"
}
func showSpinner() {
// add the spinner view controller
// addChild(spinner)
......@@ -168,11 +186,17 @@ import SwiftEventBus
moreTextViewHeight.constant = moreTextView.sizeThatFits(targetSize).height
moreButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
moreButton.accessibilityValue = "Ανεπτυγμένο"
moreButton.accessibilityHint = "Διπλό πάτημα για απόκρυψη"
} else {
moreTextView.isHidden = true
moreTextViewHeight.constant = CGFloat(0)
moreButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
moreButton.accessibilityValue = "Συμπτυγμένο"
moreButton.accessibilityHint = "Διπλό πάτημα για εμφάνιση"
}
}
......