From 22b6a70337cb766aef9d1d3aa325cb870d7160a6 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 27 Oct 2023 14:42:24 -0500 Subject: [PATCH 1/8] ONEAPP-4683 - Accessibility - Tabs (Voice Over) Signed-off-by: Matt Bruce --- VDS/Components/Tabs/Tabs.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 0fc447cd..41f70d4a 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -278,7 +278,7 @@ open class Tabs: View { tabItem.orientation = orientation tabItem.surface = surface tabItem.indicatorPosition = indicatorPosition - tabItem.accessibilityValue = "\(index+1) of \(tabViews.count) Tabs" + tabItem.accessibilityHint = "\(index+1) of \(tabViews.count) Tabs" } } From caad16f4e9b1ec7246dea0fbc0a45200b7f6ed78 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 27 Oct 2023 14:43:49 -0500 Subject: [PATCH 2/8] updated notes Signed-off-by: Matt Bruce --- VDS/SupportingFiles/ReleaseNotes.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index 6fc26df1..eecde606 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,3 +1,7 @@ +1.0.48 +======= +- ONEAPP-4683 - Accessibility - Tabs (Voice Over) + 1.0.47 ======= - ONEAPP-4684 - Acessibility - Tooltip (Header) From 94bdb22fbda961860af40d6d59e292b2fac5580d Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 2 Nov 2023 08:48:23 -0500 Subject: [PATCH 3/8] removed default text and fix issue for empty strings Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonBase.swift | 41 ++++++++++++++----------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/VDS/Components/Buttons/ButtonBase.swift b/VDS/Components/Buttons/ButtonBase.swift index 879588d1..17439074 100644 --- a/VDS/Components/Buttons/ButtonBase.swift +++ b/VDS/Components/Buttons/ButtonBase.swift @@ -158,26 +158,31 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable { //clear the arrays holding actions accessibilityCustomActions = [] - - //create the primary string - let mutableText = NSMutableAttributedString.mutableText(for: text ?? "No Text", - textStyle: textStyle, - useScaledFont: useScaledFont, - textColor: textColor, - alignment: titleLabel?.textAlignment ?? .center, - lineBreakMode: titleLabel?.lineBreakMode ?? .byTruncatingTail) - - if let attributes = textAttributes { - //loop through the models attributes - for attribute in attributes { - //add attribute on the string - attribute.setAttribute(on: mutableText) + if let text, !text.isEmpty { + //create the primary string + let mutableText = NSMutableAttributedString.mutableText(for: text, + textStyle: textStyle, + useScaledFont: useScaledFont, + textColor: textColor, + alignment: titleLabel?.textAlignment ?? .center, + lineBreakMode: titleLabel?.lineBreakMode ?? .byTruncatingTail) + + if let attributes = textAttributes { + //loop through the models attributes + for attribute in attributes { + //add attribute on the string + attribute.setAttribute(on: mutableText) + } } + + //set the attributed text + setAttributedTitle(mutableText, for: .normal) + setAttributedTitle(mutableText, for: .highlighted) + } else { + setAttributedTitle(nil, for: .normal) + setAttributedTitle(nil, for: .highlighted) + titleLabel?.text = nil } - - //set the attributed text - setAttributedTitle(mutableText, for: .normal) - setAttributedTitle(mutableText, for: .highlighted) } } From e0540a68ce957dfb60c735e33d5a75fda004bdc1 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 7 Nov 2023 08:17:46 -0600 Subject: [PATCH 4/8] added extension for NSMutableAttributedString refactoctored code to use extension Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonBase.swift | 7 ++----- .../Label/Attributes/LabelAttributeModel.swift | 11 +++++++++++ VDS/Components/Label/Label.swift | 7 +------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/VDS/Components/Buttons/ButtonBase.swift b/VDS/Components/Buttons/ButtonBase.swift index 17439074..255c6f64 100644 --- a/VDS/Components/Buttons/ButtonBase.swift +++ b/VDS/Components/Buttons/ButtonBase.swift @@ -167,12 +167,9 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable { alignment: titleLabel?.textAlignment ?? .center, lineBreakMode: titleLabel?.lineBreakMode ?? .byTruncatingTail) + //apply any attributes if let attributes = textAttributes { - //loop through the models attributes - for attribute in attributes { - //add attribute on the string - attribute.setAttribute(on: mutableText) - } + mutableText.apply(attributes: attributes) } //set the attributed text diff --git a/VDS/Components/Label/Attributes/LabelAttributeModel.swift b/VDS/Components/Label/Attributes/LabelAttributeModel.swift index 84fdc005..62e1bbd8 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeModel.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeModel.swift @@ -54,3 +54,14 @@ public extension NSAttributedString { return TextStyleLabelAttribute(location: range.location, length: range.length, textStyle: style) } } + +extension NSMutableAttributedString { + public func apply(attribute: any LabelAttributeModel) { + attribute.setAttribute(on: self) + } + + public func apply(attributes: [any LabelAttributeModel]) { + attributes.forEach { apply(attribute: $0) } + } +} + diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 0e804b30..7ecb79cd 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -273,12 +273,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { actions = [] if let attributes = attributes { - //loop through the models attributes - for attribute in attributes { - - //add attribute on the string - attribute.setAttribute(on: mutableAttributedString) - } + mutableAttributedString.apply(attributes: attributes) } } From 8b60364d63475718a1227783f8df497888fb756d Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 7 Nov 2023 08:19:55 -0600 Subject: [PATCH 5/8] updated color range to set the length if current range is 0.0 Signed-off-by: Matt Bruce --- .../Label/Attributes/ColorLabelAttribute.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/VDS/Components/Label/Attributes/ColorLabelAttribute.swift b/VDS/Components/Label/Attributes/ColorLabelAttribute.swift index e266f15f..354fbc93 100644 --- a/VDS/Components/Label/Attributes/ColorLabelAttribute.swift +++ b/VDS/Components/Label/Attributes/ColorLabelAttribute.swift @@ -23,7 +23,7 @@ public struct ColorLabelAttribute: LabelAttributeModel { //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- - public init(location: Int, length: Int, color: UIColor = .black, isForegroundColor: Bool = true) { + public init(location: Int = 0, length: Int = 0, color: UIColor = .black, isForegroundColor: Bool = true) { self.location = location self.length = length self.color = color @@ -31,8 +31,12 @@ public struct ColorLabelAttribute: LabelAttributeModel { } public func setAttribute(on attributedString: NSMutableAttributedString) { + var colorRange = range + if length == 0 && location == 0 { + colorRange = .init(location: location, length: attributedString.length) + } let attributeKey = isForegroundColor ? NSAttributedString.Key.foregroundColor : NSAttributedString.Key.backgroundColor - attributedString.removeAttribute(attributeKey, range: range) - attributedString.addAttribute(attributeKey, value: color, range: range) + attributedString.removeAttribute(attributeKey, range: colorRange) + attributedString.addAttribute(attributeKey, value: color, range: colorRange) } } From 1b82e6b2263d293249984b5ff63eea201e7421db Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 7 Nov 2023 08:21:54 -0600 Subject: [PATCH 6/8] updated notes Signed-off-by: Matt Bruce --- VDS/SupportingFiles/ReleaseNotes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index eecde606..cb769cc4 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,6 +1,7 @@ 1.0.48 ======= - ONEAPP-4683 - Accessibility - Tabs (Voice Over) +- Fix for Button/TextLink/TextLinkCaret for how empty text is dealt with 1.0.47 ======= From 08fa7e84d7b184c0035530cf6ef318457159f728 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 29 Nov 2023 15:20:57 -0600 Subject: [PATCH 7/8] added shell script for docs Signed-off-by: Matt Bruce --- vds-docs.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 vds-docs.sh diff --git a/vds-docs.sh b/vds-docs.sh new file mode 100644 index 00000000..8d5ebf6e --- /dev/null +++ b/vds-docs.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +rm -rf docsData + +echo "Building DocC documentation for VDS..." + +xcodebuild -project VDS.xcodeproj -derivedDataPath docsData -scheme VDS -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max' -parallelizeTargets docbuild + +echo "Copying DocC archives to doc_archives..." + +mkdir doc_archives + +cp -R `find docsData -type d -name "*.doccarchive"` doc_archives + +mkdir docs + +for ARCHIVE in doc_archives/*.doccarchive; do + cmd() { + echo "$ARCHIVE" | awk -F'.' '{print $1}' | awk -F'/' '{print tolower($2)}' + } + ARCHIVE_NAME="$(cmd)" + echo "Processing Archive: $ARCHIVE" + $(xcrun --find docc) process-archive transform-for-static-hosting "$ARCHIVE" --hosting-base-path / --output-path docs/$ARCHIVE_NAME +done From 956c4624062f4184a35b043bb62b6c36119f0dfa Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 30 Nov 2023 14:18:57 -0600 Subject: [PATCH 8/8] 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 c2fc5e62..8d622539 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -1175,7 +1175,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 47; + CURRENT_PROJECT_VERSION = 48; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1212,7 +1212,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 47; + CURRENT_PROJECT_VERSION = 48; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1;