From 5502dd22f7f74503e7435af774e283be8026a2d3 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 16 Jun 2020 15:16:35 +0530 Subject: [PATCH] Changes for alignment issue in iPhone 11 simulator and accessibility updates --- .../ListLeftVariableNumberedListBodyText.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift index c63b3e1a..572ede57 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift @@ -21,8 +21,9 @@ import Foundation //-------------------------------------------------- public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 10, horizontalAlignment: .fill)), - (view: headlineBody, model: StackItemModel(percent: 90, horizontalAlignment: .fill))], + + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .fill)), + (view: headlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .horizontal) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -36,10 +37,10 @@ import Foundation //-------------------------------------------------- override open func setupView() { super.setupView() - leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) + leftLabel.setContentCompressionResistancePriority(.required, for: .horizontal) + leftLabel.setContentHuggingPriority(.defaultHigh, for: .vertical) addMolecule(stack) stack.restack() - updateAccessibilityLabel() } //--------------------------------------------------- @@ -70,6 +71,8 @@ import Foundation func updateAccessibilityLabel() { + isAccessibilityElement = true + var message = "" if let leftLabel = leftLabel.text { @@ -85,6 +88,7 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } }