From 7de9eb0877b7d29ca5796affa9b4adf97dcd05ff Mon Sep 17 00:00:00 2001 From: Manos Chorianopoulos <manoschr05@gmail.com> Date: Fri, 7 Feb 2025 13:19:28 +0200 Subject: [PATCH] TelcoViewController accessibilities --- SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+), 0 deletions(-) diff --git a/SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift b/SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift index b7f404b..87f4fe4 100644 --- a/SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift +++ b/SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift @@ -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 = "Διπλό πάτημα για εμφάνιση" } } -- libgit2 0.24.0