diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift index 605acc3d..65b116f5 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift @@ -84,16 +84,22 @@ import VDSColorTokens // MARK: - TabBarProtocol @MainActor public func highlightTab(at index: Int) { - guard let newSelectedItem = items?[index] else { return } + guard let items = items, index >= 0, index < items.count else { + MVMCoreLoggingHandler.shared()?.addError(toLog: MVMCoreErrorObject(title: nil, messageToLog: "Invalid tab index \(index). \(items?.count ?? 0) tabs available .", code: 0, domain: ErrorDomainSystem, location: #function)!) + return + } tabModel.selectedTab = index - selectedItem = newSelectedItem + selectedItem = items[index] } @MainActor public func selectTab(at index: Int) { - guard let newSelectedItem = items?[index] else { return } - selectedItem = newSelectedItem - tabBar(self, didSelect: newSelectedItem) + guard let items = items, index >= 0, index < items.count else { + MVMCoreLoggingHandler.shared()?.addError(toLog: MVMCoreErrorObject(title: nil, messageToLog: "Invalid tab index \(index). \(items?.count ?? 0) tabs available.", code: 0, domain: ErrorDomainSystem, location: #function)!) + return + } + selectedItem = items[index] + tabBar(self, didSelect: items[index]) } public func currentTabIndex() -> Int { tabModel.selectedTab } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index a25426d7..da5e959e 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -88,15 +88,15 @@ var message = "" - if let eyebrowLabel = eyebrow.text { + if let eyebrowLabel = eyebrow.accessibilityLabel ?? eyebrow.text { message += eyebrowLabel + ", " } - if let headlineLabel = headline.text { + if let headlineLabel = headline.accessibilityLabel ?? headline.text { message += headlineLabel + ", " } - if let bodyLabel = body.text { + if let bodyLabel = body.accessibilityLabel ?? body.text { message += bodyLabel }