From 578cb2ef120cea8ec0105812b2784cc0c152849b Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 31 Jan 2024 10:10:01 -0600 Subject: [PATCH 1/9] ONEAPP-6244 - TitleLockup TitleLabel marked as .heading for Accessibility Signed-off-by: Matt Bruce --- VDS/Components/TitleLockup/TitleLockup.swift | 2 ++ VDS/SupportingFiles/ReleaseNotes.txt | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/VDS/Components/TitleLockup/TitleLockup.swift b/VDS/Components/TitleLockup/TitleLockup.swift index 455ed92b..6567de25 100644 --- a/VDS/Components/TitleLockup/TitleLockup.swift +++ b/VDS/Components/TitleLockup/TitleLockup.swift @@ -77,6 +77,7 @@ open class TitleLockup: View { /// Label used to render the title model. open var titleLabel = Label().with { $0.setContentCompressionResistancePriority(.required, for: .vertical) + $0.accessibilityTraits.insert([.header]) } /// Model used in rendering the title label. @@ -388,3 +389,4 @@ open class TitleLockup: View { } } +6 diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index bf045627..b4ae5bbb 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,3 +1,7 @@ +1.0.52 +---------------- +- ONEAPP-6244 - TitleLockup TitleLabel marked as .heading for Accessibility. + 1.0.51 ---------------- - ONEAPP-6239 - Loader is still showing when inactive. From 4e0832fa64fe7a33995b2ebe6cc204338f00e99b Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 31 Jan 2024 14:37:59 -0600 Subject: [PATCH 2/9] updated version Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 28cadb8a..c28da8f9 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -1233,7 +1233,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 51; + CURRENT_PROJECT_VERSION = 52; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1270,7 +1270,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 51; + CURRENT_PROJECT_VERSION = 52; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; From 01fcc57ba2fae8454bc7743108e20ef6fdfb7739 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 31 Jan 2024 14:40:07 -0600 Subject: [PATCH 3/9] updated textLinkCaret to allow word wrapping Signed-off-by: Matt Bruce --- VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift index fd990720..aaa9f3cb 100644 --- a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift +++ b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift @@ -80,6 +80,8 @@ open class TextLinkCaret: ButtonBase { open override func setup() { super.setup() accessibilityTraits = .link + titleLabel?.numberOfLines = 0 + titleLabel?.lineBreakMode = .byWordWrapping } /// Used to make changes to the View based off a change events or from local properties. From 928483657d679bce17fa0da99183ea64d6b42974 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 31 Jan 2024 14:47:01 -0600 Subject: [PATCH 4/9] remvoed bug Signed-off-by: Matt Bruce --- VDS/Components/TitleLockup/TitleLockup.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/VDS/Components/TitleLockup/TitleLockup.swift b/VDS/Components/TitleLockup/TitleLockup.swift index 6567de25..dbfd8637 100644 --- a/VDS/Components/TitleLockup/TitleLockup.swift +++ b/VDS/Components/TitleLockup/TitleLockup.swift @@ -389,4 +389,3 @@ open class TitleLockup: View { } } -6 From 3720541b42c8078aec0c734aa1d22db341b9dddd Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 6 Feb 2024 14:38:22 -0600 Subject: [PATCH 5/9] ONEAPP-4683 - updated to accesibilityValue for the tabs position. Signed-off-by: Matt Bruce --- VDS/Components/Tabs/Tabs.swift | 5 ++++- VDS/SupportingFiles/ReleaseNotes.txt | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index d6273771..0aa81bdf 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -171,6 +171,8 @@ open class Tabs: View { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() + isAccessibilityElement = false + scrollView = UIScrollView() scrollView.translatesAutoresizingMaskIntoConstraints = false scrollView.showsHorizontalScrollIndicator = false @@ -262,6 +264,7 @@ open class Tabs: View { model.onClick?(tab.index) self.selectedIndex = tab.index self.onTabDidSelect?(tab.index) + let t = tabViews[tab.index] } } } @@ -301,7 +304,7 @@ open class Tabs: View { tabItem.orientation = orientation tabItem.surface = surface tabItem.indicatorPosition = indicatorPosition - tabItem.accessibilityHint = "\(index+1) of \(tabViews.count) Tabs" + tabItem.accessibilityValue = "\(index+1) of \(tabViews.count) Tabs" } } diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index b4ae5bbb..04a04a10 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,3 +1,7 @@ +1.0.53 +---------------- +- ONEAPP-4683 - Updated to accesibilityValue for the tabs position. + 1.0.52 ---------------- - ONEAPP-6244 - TitleLockup TitleLabel marked as .heading for Accessibility. From f66d15fdfca05dcbaec20ef932a028bf43b523ce Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 6 Feb 2024 14:48:23 -0600 Subject: [PATCH 6/9] updated version Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index c28da8f9..74159fed 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -1233,7 +1233,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 52; + CURRENT_PROJECT_VERSION = 53; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1270,7 +1270,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 52; + CURRENT_PROJECT_VERSION = 53; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; From bbc36c72d3ec34884de64fdc3bbcfe6e3d1f34a3 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 7 Feb 2024 15:45:56 -0600 Subject: [PATCH 7/9] CXTDT-516206 - ButtonGroup iOS 16 issue Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 9cf82696..ba2a83d8 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -190,8 +190,8 @@ extension ButtonGroup: UICollectionViewDataSource, UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let button = buttons[indexPath.row] guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) as? ButtonGroupCollectionViewCell else { return UICollectionViewCell() } - cell.subviews.forEach { $0.removeFromSuperview() } - cell.addSubview(button) + cell.contentView.subviews.forEach { $0.removeFromSuperview() } + cell.contentView.addSubview(button) button.pinToSuperView() if hasDebugBorder { cell.addDebugBorder() From ba63562445da2e8c9e1c546800d51756c8c6a9be Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 7 Feb 2024 15:45:56 -0600 Subject: [PATCH 8/9] CXTDT-516206 - ButtonGroup iOS 16 issue Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 1fdbc56d..113d19f5 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -201,8 +201,8 @@ extension ButtonGroup: UICollectionViewDataSource, UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let button = buttons[indexPath.row] guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) as? ButtonGroupCollectionViewCell else { return UICollectionViewCell() } - cell.subviews.forEach { $0.removeFromSuperview() } - cell.addSubview(button) + cell.contentView.subviews.forEach { $0.removeFromSuperview() } + cell.contentView.addSubview(button) button.pinToSuperView() if hasDebugBorder { cell.addDebugBorder() From b535fe5323ff3512ba534f117dd3107023c56c6c Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 8 Feb 2024 17:05:28 -0600 Subject: [PATCH 9/9] CXTDT-518373 - Accessibility on Loader Signed-off-by: Matt Bruce --- VDS/Components/Loader/Loader.swift | 7 +++--- VDS/Extensions/UIView+Accessibility.swift | 26 +++++++++++++++++++++++ VDS/SupportingFiles/ReleaseNotes.txt | 4 ++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/VDS/Components/Loader/Loader.swift b/VDS/Components/Loader/Loader.swift index f765c4e6..90d589be 100644 --- a/VDS/Components/Loader/Loader.swift +++ b/VDS/Components/Loader/Loader.swift @@ -120,11 +120,12 @@ open class Loader: View { // setup timer for post loadingTimer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in - self?.accessibilityLabel = "Still Loading" + guard let self, self.isActive, self.isVisibleOnScreen else { return } + self.accessibilityLabel = "Still Loading" UIAccessibility.post(notification: .announcement, argument: "Still Loading") } } - + private func stopAnimating() { isAccessibilityElement = false icon.isHidden = true @@ -132,7 +133,7 @@ open class Loader: View { loadingTimer?.invalidate() loadingTimer = nil } - + deinit { stopAnimating() } diff --git a/VDS/Extensions/UIView+Accessibility.swift b/VDS/Extensions/UIView+Accessibility.swift index 6c785c5e..e85b3f74 100644 --- a/VDS/Extensions/UIView+Accessibility.swift +++ b/VDS/Extensions/UIView+Accessibility.swift @@ -24,4 +24,30 @@ extension UIView { public func setAccessibilityLabel(for views: [UIView]) { accessibilityLabel = combineAccessibilityLabel(for: views) } + + /// Will tell if the view is actually visibile on screen, also it will check the hierarchy above this view. + public var isVisibleOnScreen: Bool { + // Ensure the view has a window, meaning it's part of the view hierarchy + guard let window = self.window, !self.isHidden, self.alpha > 0 else { + return false + } + + // Check if the view's frame intersects with the window's bounds + let viewFrameInWindow = self.convert(self.bounds, to: window) + var isIntersecting = viewFrameInWindow.intersects(window.bounds) + + // Check parent views for visibility + var currentView: UIView? = self + while let view = currentView, isIntersecting { + // If any parent has a constraint making it effectively invisible, set isIntersecting to false + if view.bounds.size.width == 0 || view.bounds.size.height == 0 { + isIntersecting = false + break + } + currentView = view.superview + } + + return isIntersecting + } + } diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index 04a04a10..fb0acb61 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,3 +1,7 @@ +1.0.54 +---------------- +- CXTDT-518373 Accessibility Voiceover is reading “Still Loading” after waiting for a short time in all the screens. + 1.0.53 ---------------- - ONEAPP-4683 - Updated to accesibilityValue for the tabs position.