From 97dec0f9d2c64d05e1724fc31b94b126c729f052 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 5 Dec 2022 16:25:16 -0500 Subject: [PATCH] Add accessibility hint for segmented controls --- Tusker/Screens/Utilities/SegmentedPageViewController.swift | 3 +++ Tusker/Views/Profile Header/ProfileHeaderView.swift | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Tusker/Screens/Utilities/SegmentedPageViewController.swift b/Tusker/Screens/Utilities/SegmentedPageViewController.swift index ff3e8fdb..cbd39cbb 100644 --- a/Tusker/Screens/Utilities/SegmentedPageViewController.swift +++ b/Tusker/Screens/Utilities/SegmentedPageViewController.swift @@ -32,6 +32,9 @@ class SegmentedPageViewController: UIPageViewController, UIPageViewControllerDel // before the view has necessarily loaded segmentedControl = UISegmentedControl(items: titles) segmentedControl.addTarget(self, action: #selector(segmentedControlChanged), for: .valueChanged) + // the segemented control itself is only focusable when VoiceOver is in Group navigation mode, + // so make it clear that to switch tabs the user needs to enter the group + segmentedControl.accessibilityHint = "Enter group to select timeline" navigationItem.titleView = segmentedControl } diff --git a/Tusker/Views/Profile Header/ProfileHeaderView.swift b/Tusker/Views/Profile Header/ProfileHeaderView.swift index b7cabfbe..4a3d1d37 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderView.swift +++ b/Tusker/Views/Profile Header/ProfileHeaderView.swift @@ -83,6 +83,10 @@ class ProfileHeaderView: UIView { noteTextView.defaultFont = .preferredFont(forTextStyle: .body) noteTextView.adjustsFontForContentSizeCategory = true + // the segemented control itself is only focusable when VoiceOver is in Group navigation mode, + // so make it clear that to switch tabs the user needs to enter the group + pagesSegmentedControl.accessibilityHint = "Enter group to select scope" + NotificationCenter.default.addObserver(self, selector: #selector(updateUIForPreferences), name: .preferencesChanged, object: nil) }