Manos Chorianopoulos

ContextualViewController accessibilities

......@@ -111,6 +111,7 @@ import SwiftEventBus
toggleTerms()
setupAccessibilty()
}
public override func viewWillAppear(_ animated: Bool) {
......@@ -123,6 +124,23 @@ import SwiftEventBus
// MARK: - Functions
func setupAccessibilty() {
couponImage.isAccessibilityElement = true
couponImage.accessibilityLabel = "Φωτογραφία εκπτωτικού κουπονιού"
couponImage.accessibilityTraits = .image
redeemButton.isAccessibilityElement = true
redeemButton.accessibilityLabel = redeemButton.title(for: .normal)
redeemButton.accessibilityHint = "Διπλό πάτημα για άνοιγμα"
redeemButton.accessibilityTraits = .button
termsButton.isAccessibilityElement = true
termsButton.accessibilityLabel = termsButton.title(for: .normal)
termsButton.accessibilityHint = "Διπλό πάτημα για εμφάνιση"
termsButton.accessibilityTraits = .button
termsButton.accessibilityValue = "Συμπτυγμένο"
}
func showSpinner() {
// add the spinner view controller
// addChild(spinner)
......@@ -150,11 +168,17 @@ import SwiftEventBus
termsTextViewHeight.constant = termsTextView.sizeThatFits(targetSize).height
termsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
termsButton.accessibilityValue = "Ανεπτυγμένο"
termsButton.accessibilityHint = "Διπλό πάτημα για απόκρυψη"
} else {
termsTextView.isHidden = true
termsTextViewHeight.constant = CGFloat(0)
termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
termsButton.accessibilityValue = "Συμπτυγμένο"
termsButton.accessibilityHint = "Διπλό πάτημα για εμφάνιση"
}
}
......