removing for headers
This commit is contained in:
parent
15e8f45293
commit
201e328169
@ -40,7 +40,6 @@ import Foundation
|
|||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
updateAccessibilityLabel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
@ -54,7 +53,6 @@ import Foundation
|
|||||||
|
|
||||||
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
buttons.set(with: model.buttons, delegateObject, additionalData)
|
buttons.set(with: model.buttons, delegateObject, additionalData)
|
||||||
updateAccessibilityLabel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
@ -65,72 +63,4 @@ import Foundation
|
|||||||
super.reset()
|
super.reset()
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
|
||||||
// MARK: - Accessibility
|
|
||||||
//--------------------------------------------------
|
|
||||||
|
|
||||||
func updateAccessibilityLabel() {
|
|
||||||
|
|
||||||
var message = ""
|
|
||||||
|
|
||||||
if let headlineText = headlineBody.headlineLabel.text, !headlineText.isEmpty {
|
|
||||||
message += headlineText + ", "
|
|
||||||
}
|
|
||||||
|
|
||||||
if let messageText = headlineBody.messageLabel.text, !messageText.isEmpty {
|
|
||||||
message += messageText + ", "
|
|
||||||
}
|
|
||||||
|
|
||||||
let secondaryButtonIsDisplayed = !buttons.secondaryButton.isHidden
|
|
||||||
let primaryButtonIsDisplayed = !buttons.primaryButton.isHidden
|
|
||||||
|
|
||||||
// Both links are displayed
|
|
||||||
if secondaryButtonIsDisplayed && primaryButtonIsDisplayed {
|
|
||||||
isAccessibilityElement = false
|
|
||||||
var views = [UIView]()
|
|
||||||
|
|
||||||
if let headlineText = headlineBody.headlineLabel.text, !headlineText.isEmpty {
|
|
||||||
views.append(headlineBody.headlineLabel)
|
|
||||||
}
|
|
||||||
|
|
||||||
if let messageText = headlineBody.messageLabel.text, !messageText.isEmpty {
|
|
||||||
views.append(headlineBody.messageLabel)
|
|
||||||
}
|
|
||||||
|
|
||||||
views.append(buttons.secondaryButton)
|
|
||||||
views.append(buttons.primaryButton)
|
|
||||||
|
|
||||||
accessibilityElements = views
|
|
||||||
return
|
|
||||||
|
|
||||||
} else if secondaryButtonIsDisplayed {
|
|
||||||
accessibilityHint = buttons.secondaryButton.accessibilityHint
|
|
||||||
accessibilityTraits = buttons.secondaryButton.accessibilityTraits
|
|
||||||
message += buttons.secondaryButton.accessibilityLabel ?? ""
|
|
||||||
|
|
||||||
} else if primaryButtonIsDisplayed {
|
|
||||||
accessibilityHint = buttons.primaryButton.accessibilityHint
|
|
||||||
accessibilityTraits = buttons.primaryButton.accessibilityTraits
|
|
||||||
message += buttons.primaryButton.accessibilityLabel ?? ""
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
isAccessibilityElement = true
|
|
||||||
accessibilityLabel = message
|
|
||||||
}
|
|
||||||
|
|
||||||
open override func accessibilityActivate() -> Bool {
|
|
||||||
|
|
||||||
if isAccessibilityElement {
|
|
||||||
if !buttons.secondaryButton.isHidden {
|
|
||||||
return buttons.secondaryButton.accessibilityActivate()
|
|
||||||
|
|
||||||
} else if !buttons.primaryButton.isHidden {
|
|
||||||
return buttons.primaryButton.accessibilityActivate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,6 @@ import Foundation
|
|||||||
super.setupView()
|
super.setupView()
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
addMolecule(headlineBody)
|
addMolecule(headlineBody)
|
||||||
isAccessibilityElement = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
@ -36,7 +35,6 @@ import Foundation
|
|||||||
guard let model = model as? HeadersH2NoButtonsBodyTextModel else { return }
|
guard let model = model as? HeadersH2NoButtonsBodyTextModel else { return }
|
||||||
|
|
||||||
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
updateAccessibilityLabel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
@ -47,23 +45,4 @@ import Foundation
|
|||||||
super.reset()
|
super.reset()
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
|
||||||
// MARK: - Accessibility
|
|
||||||
//----------------------------------------------------
|
|
||||||
|
|
||||||
func updateAccessibilityLabel() {
|
|
||||||
|
|
||||||
var message = ""
|
|
||||||
|
|
||||||
if let headlineLabel = headlineBody.headlineLabel.text {
|
|
||||||
message += headlineLabel + ", "
|
|
||||||
}
|
|
||||||
|
|
||||||
if let messageLabel = headlineBody.messageLabel.text {
|
|
||||||
message += messageLabel
|
|
||||||
}
|
|
||||||
|
|
||||||
accessibilityLabel = message
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,6 @@ import Foundation
|
|||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
isAccessibilityElement = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
@ -62,7 +61,6 @@ import Foundation
|
|||||||
|
|
||||||
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
button.set(with: model.button, delegateObject, additionalData)
|
button.set(with: model.button, delegateObject, additionalData)
|
||||||
updateAccessibilityLabel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
@ -73,33 +71,4 @@ import Foundation
|
|||||||
super.reset()
|
super.reset()
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
|
||||||
// MARK: - Accessibility
|
|
||||||
//----------------------------------------------------
|
|
||||||
|
|
||||||
func updateAccessibilityLabel() {
|
|
||||||
|
|
||||||
var message = ""
|
|
||||||
|
|
||||||
if let headlineLabel = headlineBody.headlineLabel.text, !headlineLabel.isEmpty {
|
|
||||||
message += headlineLabel + ", "
|
|
||||||
}
|
|
||||||
|
|
||||||
if let bodyLabel = headlineBody.messageLabel.text, !bodyLabel.isEmpty {
|
|
||||||
message += bodyLabel + ", "
|
|
||||||
}
|
|
||||||
|
|
||||||
if let buttonLabel = button.accessibilityLabel {
|
|
||||||
message += buttonLabel
|
|
||||||
}
|
|
||||||
|
|
||||||
accessibilityLabel = message
|
|
||||||
accessibilityHint = button.accessibilityHint
|
|
||||||
accessibilityTraits = button.accessibilityTraits
|
|
||||||
}
|
|
||||||
|
|
||||||
open override func accessibilityActivate() -> Bool {
|
|
||||||
return button.accessibilityActivate()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user