Adding accessibility ids for closed group testing, messaging tests, onboarding tests and linked device testing

pull/713/head
Emily 3 years ago
parent 6d36450b83
commit f1dd8a8a53

@ -13,6 +13,8 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
let profileId: String let profileId: String
let role: GroupMember.Role let role: GroupMember.Role
let profile: Profile? let profile: Profile?
let accessibilityLabel: String?
let accessibilityId: String?
} }
private let threadId: String private let threadId: String
@ -31,6 +33,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
private lazy var groupNameLabel: UILabel = { private lazy var groupNameLabel: UILabel = {
let result: UILabel = UILabel() let result: UILabel = UILabel()
result.accessibilityLabel = "Group name" result.accessibilityLabel = "Group name"
result.isAccessibilityElement = true
result.font = .boldSystemFont(ofSize: Values.veryLargeFontSize) result.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
result.themeTextColor = .textPrimary result.themeTextColor = .textPrimary
result.lineBreakMode = .byTruncatingTail result.lineBreakMode = .byTruncatingTail
@ -45,6 +48,8 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
usesDefaultHeight: false usesDefaultHeight: false
) )
result.textAlignment = .center result.textAlignment = .center
result.isAccessibilityElement = true
result.accessibilityIdentifier = "Group name text field"
return result return result
}() }()
@ -52,6 +57,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
private lazy var addMembersButton: SessionButton = { private lazy var addMembersButton: SessionButton = {
let result: SessionButton = SessionButton(style: .bordered, size: .medium) let result: SessionButton = SessionButton(style: .bordered, size: .medium)
result.accessibilityLabel = "Add members" result.accessibilityLabel = "Add members"
result.isAccessibilityElement = true
result.setTitle("vc_conversation_settings_invite_button_title".localized(), for: .normal) result.setTitle("vc_conversation_settings_invite_button_title".localized(), for: .normal)
result.addTarget(self, action: #selector(addMembers), for: UIControl.Event.touchUpInside) result.addTarget(self, action: #selector(addMembers), for: UIControl.Event.touchUpInside)
result.contentEdgeInsets = UIEdgeInsets(top: 0, leading: Values.mediumSpacing, bottom: 0, trailing: Values.mediumSpacing) result.contentEdgeInsets = UIEdgeInsets(top: 0, leading: Values.mediumSpacing, bottom: 0, trailing: Values.mediumSpacing)
@ -62,6 +68,8 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
@objc private lazy var tableView: UITableView = { @objc private lazy var tableView: UITableView = {
let result: UITableView = UITableView() let result: UITableView = UITableView()
result.accessibilityLabel = "Contact" result.accessibilityLabel = "Contact"
result.accessibilityIdentifier = "Contact"
result.isAccessibilityElement = true
result.dataSource = self result.dataSource = self
result.delegate = self result.delegate = self
result.separatorStyle = .none result.separatorStyle = .none
@ -352,7 +360,9 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
GroupMemberDisplayInfo( GroupMemberDisplayInfo(
profileId: profile.id, profileId: profile.id,
role: .standard, role: .standard,
profile: profile profile: profile,
accessibilityLabel: "Contact",
accessibilityId: "Contact"
) )
} }
self?.membersAndZombies = (self?.membersAndZombies ?? []) self?.membersAndZombies = (self?.membersAndZombies ?? [])

@ -48,6 +48,8 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
result.themeBorderColor = .borderSeparator result.themeBorderColor = .borderSeparator
result.layer.cornerRadius = 13 result.layer.cornerRadius = 13
result.delegate = self result.delegate = self
result.accessibilityIdentifier = "Group name input"
result.isAccessibilityElement = true
return result return result
}() }()
@ -133,6 +135,8 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
result.translatesAutoresizingMaskIntoConstraints = false result.translatesAutoresizingMaskIntoConstraints = false
result.setTitle("CREATE_GROUP_BUTTON_TITLE".localized(), for: .normal) result.setTitle("CREATE_GROUP_BUTTON_TITLE".localized(), for: .normal)
result.addTarget(self, action: #selector(createClosedGroup), for: .touchUpInside) result.addTarget(self, action: #selector(createClosedGroup), for: .touchUpInside)
result.accessibilityIdentifier = "Create group"
result.isAccessibilityElement = true
result.set(.width, to: 160) result.set(.width, to: 160)
return result return result
@ -151,6 +155,8 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close)) let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
closeButton.themeTintColor = .textPrimary closeButton.themeTintColor = .textPrimary
navigationItem.rightBarButtonItem = closeButton navigationItem.rightBarButtonItem = closeButton
navigationItem.leftBarButtonItem?.accessibilityIdentifier = "Cancel"
navigationItem.leftBarButtonItem?.isAccessibilityElement = true
// Set up content // Set up content
setUpViewHierarchy() setUpViewHierarchy()
@ -204,8 +210,9 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
title: profile.displayName(), title: profile.displayName(),
rightAccessory: .radio(isSelected: { [weak self] in rightAccessory: .radio(isSelected: { [weak self] in
self?.selectedContacts.contains(profile.id) == true self?.selectedContacts.contains(profile.id) == true
}) }),
), accessibilityIdentifier: "Contact"
),
style: .edgeToEdge, style: .edgeToEdge,
position: Position.with(indexPath.row, count: data[indexPath.section].elements.count) position: Position.with(indexPath.row, count: data[indexPath.section].elements.count)
) )
@ -286,6 +293,7 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
explanation: message, explanation: message,
cancelTitle: "BUTTON_OK".localized(), cancelTitle: "BUTTON_OK".localized(),
cancelStyle: .alert_text cancelStyle: .alert_text
) )
) )
present(modal, animated: true) present(modal, animated: true)

@ -137,6 +137,8 @@ extension ConversationVC:
range: (message as NSString).range(of: self.viewModel.threadData.displayName) range: (message as NSString).range(of: self.viewModel.threadData.displayName)
), ),
confirmTitle: "modal_blocked_button_title".localized(), confirmTitle: "modal_blocked_button_title".localized(),
confirmAccessibilityLabel: "Confirm block",
cancelAccessibilityLabel: "Cancel block",
dismissOnConfirm: false // Custom dismissal logic dismissOnConfirm: false // Custom dismissal logic
) { [weak self] _ in ) { [weak self] _ in
self?.viewModel.unblockContact() self?.viewModel.unblockContact()

@ -268,7 +268,9 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate {
lastSearchText: String? lastSearchText: String?
) { ) {
self.viewModel = cellViewModel self.viewModel = cellViewModel
self.bubbleView.accessibilityIdentifier = "Message Body"
self.bubbleView.isAccessibilityElement = true
self.bubbleView.accessibilityLabel = cellViewModel.body
// We want to add spacing between "clusters" of messages to indicate that time has // We want to add spacing between "clusters" of messages to indicate that time has
// passed (even if there wasn't enough time to warrant showing a date header) // passed (even if there wasn't enough time to warrant showing a date header)
let shouldAddTopInset: Bool = ( let shouldAddTopInset: Bool = (

@ -120,7 +120,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
NavItem( NavItem(
id: .done, id: .done,
systemItem: .done, systemItem: .done,
accessibilityIdentifier: "Done button" accessibilityIdentifier: "Done"
) { [weak self] in ) { [weak self] in
self?.setIsEditing(false) self?.setIsEditing(false)
@ -128,6 +128,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
self?.threadVariant == .contact, self?.threadVariant == .contact,
let threadId: String = self?.threadId, let threadId: String = self?.threadId,
let editedDisplayName: String = self?.editedDisplayName let editedDisplayName: String = self?.editedDisplayName
else { return } else { return }
let updatedNickname: String = editedDisplayName let updatedNickname: String = editedDisplayName
@ -182,7 +183,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
/// fetch (after the ones in `ValueConcurrentObserver.asyncStart`/`ValueConcurrentObserver.syncStart`) /// fetch (after the ones in `ValueConcurrentObserver.asyncStart`/`ValueConcurrentObserver.syncStart`)
/// just in case the database has changed between the two reads - unfortunately it doesn't look like there is a way to prevent this /// just in case the database has changed between the two reads - unfortunately it doesn't look like there is a way to prevent this
private lazy var _observableSettingsData: ObservableData = ValueObservation private lazy var _observableSettingsData: ObservableData = ValueObservation
.trackingConstantRegion { [weak self, dependencies, threadId = self.threadId, threadVariant = self.threadVariant] db -> [SectionModel] in .trackingConstantRegion { [weak self, dependencies, threadId = self.threadId, threadVariant = self.threadVariant] db -> [SectionModel] in
let userPublicKey: String = getUserHexEncodedPublicKey(db, dependencies: dependencies) let userPublicKey: String = getUserHexEncodedPublicKey(db, dependencies: dependencies)
let maybeThreadViewModel: SessionThreadViewModel? = try SessionThreadViewModel let maybeThreadViewModel: SessionThreadViewModel? = try SessionThreadViewModel
.conversationSettingsQuery(threadId: threadId, userPublicKey: userPublicKey) .conversationSettingsQuery(threadId: threadId, userPublicKey: userPublicKey)
@ -351,7 +352,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
.withRenderingMode(.alwaysTemplate) .withRenderingMode(.alwaysTemplate)
), ),
title: "EDIT_GROUP_ACTION".localized(), title: "EDIT_GROUP_ACTION".localized(),
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).edit_group", accessibilityIdentifier: "Edit group",
accessibilityLabel: "Edit group", accessibilityLabel: "Edit group",
onTap: { [weak self] in onTap: { [weak self] in
self?.transitionToScreen(EditClosedGroupVC(threadId: threadId)) self?.transitionToScreen(EditClosedGroupVC(threadId: threadId))
@ -367,7 +368,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
.withRenderingMode(.alwaysTemplate) .withRenderingMode(.alwaysTemplate)
), ),
title: "LEAVE_GROUP_ACTION".localized(), title: "LEAVE_GROUP_ACTION".localized(),
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).leave_group", accessibilityIdentifier: "Leave group",
accessibilityLabel: "Leave group", accessibilityLabel: "Leave group",
confirmationInfo: ConfirmationModal.Info( confirmationInfo: ConfirmationModal.Info(
title: "CONFIRM_LEAVE_GROUP_TITLE".localized(), title: "CONFIRM_LEAVE_GROUP_TITLE".localized(),
@ -424,7 +425,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
threadViewModel.threadVariant != .closedGroup || threadViewModel.threadVariant != .closedGroup ||
currentUserIsClosedGroupMember currentUserIsClosedGroupMember
), ),
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).notify_for_mentions_only", accessibilityIdentifier: "Mentions only notification setting",
accessibilityLabel: "Mentions only", accessibilityLabel: "Mentions only",
onTap: { onTap: {
let newValue: Bool = !(threadViewModel.threadOnlyNotifyForMentions == true) let newValue: Bool = !(threadViewModel.threadOnlyNotifyForMentions == true)
@ -514,12 +515,11 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
nil : nil :
"BLOCK_USER_BEHAVIOR_EXPLANATION".localized() "BLOCK_USER_BEHAVIOR_EXPLANATION".localized()
), ),
accessibilityLabel: "Confirm block",
confirmTitle: (threadViewModel.threadIsBlocked == true ? confirmTitle: (threadViewModel.threadIsBlocked == true ?
"BLOCK_LIST_UNBLOCK_BUTTON".localized() : "BLOCK_LIST_UNBLOCK_BUTTON".localized() :
"BLOCK_LIST_BLOCK_BUTTON".localized() "BLOCK_LIST_BLOCK_BUTTON".localized()
), ),
confirmAccessibilityLabel: "Confirm blocked user", confirmAccessibilityLabel: "Confirm block",
confirmStyle: .danger, confirmStyle: .danger,
cancelStyle: .alert_text cancelStyle: .alert_text
), ),
@ -652,7 +652,9 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
nil nil
), ),
accessibilityLabel: oldBlockedState == false ? "User blocked" : "Confirm unblock", accessibilityLabel: oldBlockedState == false ? "User blocked" : "Confirm unblock",
accessibilityId: "OK",
cancelTitle: "BUTTON_OK".localized(), cancelTitle: "BUTTON_OK".localized(),
cancelAccessibilityLabel: "OK",
cancelStyle: .alert_text cancelStyle: .alert_text
) )
) )

@ -22,7 +22,6 @@ final class ConversationTitleView: UIView {
private lazy var titleLabel: UILabel = { private lazy var titleLabel: UILabel = {
let result: UILabel = UILabel() let result: UILabel = UILabel()
result.accessibilityLabel = "Username"
result.font = .boldSystemFont(ofSize: Values.mediumFontSize) result.font = .boldSystemFont(ofSize: Values.mediumFontSize)
result.themeTextColor = .textPrimary result.themeTextColor = .textPrimary
result.lineBreakMode = .byTruncatingTail result.lineBreakMode = .byTruncatingTail
@ -125,6 +124,9 @@ final class ConversationTitleView: UIView {
) )
self.titleLabel.text = name self.titleLabel.text = name
self.titleLabel.accessibilityIdentifier = "Username"
self.titleLabel.isAccessibilityElement = true
self.titleLabel.accessibilityLabel = name
self.titleLabel.font = .boldSystemFont( self.titleLabel.font = .boldSystemFont(
ofSize: (shouldHaveSubtitle ? ofSize: (shouldHaveSubtitle ?
Values.mediumFontSize : Values.mediumFontSize :

@ -466,6 +466,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
// Profile picture view // Profile picture view
let profilePictureSize = Values.verySmallProfilePictureSize let profilePictureSize = Values.verySmallProfilePictureSize
let profilePictureView = ProfilePictureView() let profilePictureView = ProfilePictureView()
profilePictureView.accessibilityIdentifier = "User settings"
profilePictureView.accessibilityLabel = "User settings" profilePictureView.accessibilityLabel = "User settings"
profilePictureView.isAccessibilityElement = true profilePictureView.isAccessibilityElement = true
profilePictureView.size = profilePictureSize profilePictureView.size = profilePictureSize
@ -532,6 +533,8 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
let threadViewModel: SessionThreadViewModel = section.elements[indexPath.row] let threadViewModel: SessionThreadViewModel = section.elements[indexPath.row]
let cell: FullConversationCell = tableView.dequeue(type: FullConversationCell.self, for: indexPath) let cell: FullConversationCell = tableView.dequeue(type: FullConversationCell.self, for: indexPath)
cell.update(with: threadViewModel) cell.update(with: threadViewModel)
cell.accessibilityIdentifier = "Conversation list item"
cell.accessibilityLabel = threadViewModel.displayName
return cell return cell
default: preconditionFailure("Other sections should have no content") default: preconditionFailure("Other sections should have no content")

@ -173,6 +173,7 @@ final class RegisterVC : BaseVC {
let hexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey let hexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey
publicKeyLabel.accessibilityLabel = hexEncodedPublicKey publicKeyLabel.accessibilityLabel = hexEncodedPublicKey
publicKeyLabel.accessibilityIdentifier = "Session ID generated" publicKeyLabel.accessibilityIdentifier = "Session ID generated"
publicKeyLabel.isAccessibilityElement = true
let characterCount = hexEncodedPublicKey.count let characterCount = hexEncodedPublicKey.count
var count = 0 var count = 0
let limit = 32 let limit = 32

@ -124,7 +124,7 @@ class SettingsViewModel: SessionTableViewModel<SettingsViewModel.NavButton, Sett
NavItem( NavItem(
id: .done, id: .done,
systemItem: .done, systemItem: .done,
accessibilityIdentifier: "Done button" accessibilityIdentifier: "Done"
) { [weak self] in ) { [weak self] in
let updatedNickname: String = (self?.editedDisplayName ?? "") let updatedNickname: String = (self?.editedDisplayName ?? "")
.trimmingCharacters(in: .whitespacesAndNewlines) .trimmingCharacters(in: .whitespacesAndNewlines)

@ -72,7 +72,8 @@ final class UserSelectionVC: BaseVC, UITableViewDataSource, UITableViewDelegate
title: profile.displayName(), title: profile.displayName(),
rightAccessory: .radio(isSelected: { [weak self] in rightAccessory: .radio(isSelected: { [weak self] in
self?.selectedUsers.contains(profile.id) == true self?.selectedUsers.contains(profile.id) == true
}) }),
accessibilityIdentifier: "Contact"
), ),
style: .edgeToEdge, style: .edgeToEdge,
position: Position.with(indexPath.row, count: users.count) position: Position.with(indexPath.row, count: users.count)

@ -63,7 +63,7 @@ class SessionAvatarCell: UITableViewCell {
fileprivate let displayNameContainer: UIView = { fileprivate let displayNameContainer: UIView = {
let view: UIView = UIView() let view: UIView = UIView()
view.translatesAutoresizingMaskIntoConstraints = false view.translatesAutoresizingMaskIntoConstraints = false
view.accessibilityLabel = "Edit name text field" view.accessibilityLabel = "Username"
view.isAccessibilityElement = true view.isAccessibilityElement = true
return view return view
@ -71,7 +71,6 @@ class SessionAvatarCell: UITableViewCell {
private lazy var displayNameLabel: UILabel = { private lazy var displayNameLabel: UILabel = {
let label: UILabel = UILabel() let label: UILabel = UILabel()
label.accessibilityLabel = "Username"
label.isAccessibilityElement = true label.isAccessibilityElement = true
label.translatesAutoresizingMaskIntoConstraints = false label.translatesAutoresizingMaskIntoConstraints = false
label.font = .ows_mediumFont(withSize: Values.veryLargeFontSize) label.font = .ows_mediumFont(withSize: Values.veryLargeFontSize)
@ -87,7 +86,9 @@ class SessionAvatarCell: UITableViewCell {
let textField: TextField = TextField(placeholder: "Enter a name", usesDefaultHeight: false) let textField: TextField = TextField(placeholder: "Enter a name", usesDefaultHeight: false)
textField.translatesAutoresizingMaskIntoConstraints = false textField.translatesAutoresizingMaskIntoConstraints = false
textField.textAlignment = .center textField.textAlignment = .center
textField.accessibilityLabel = "Edit name text field" textField.accessibilityIdentifier = "Nickname"
textField.accessibilityLabel = "Nickname"
textField.isAccessibilityElement = true
textField.alpha = 0 textField.alpha = 0
return textField return textField

@ -309,6 +309,7 @@ public class SessionCell: UITableViewCell {
self.onExtraActionTap = info.extraAction?.onTap self.onExtraActionTap = info.extraAction?.onTap
self.accessibilityIdentifier = info.accessibilityIdentifier self.accessibilityIdentifier = info.accessibilityIdentifier
self.accessibilityLabel = info.accessibilityLabel self.accessibilityLabel = info.accessibilityLabel
self.isAccessibilityElement = true
let leftFitToEdge: Bool = (info.leftAccessory?.shouldFitToEdge == true) let leftFitToEdge: Bool = (info.leftAccessory?.shouldFitToEdge == true)
let rightFitToEdge: Bool = (!leftFitToEdge && info.rightAccessory?.shouldFitToEdge == true) let rightFitToEdge: Bool = (!leftFitToEdge && info.rightAccessory?.shouldFitToEdge == true)

@ -228,7 +228,7 @@ class ThreadSettingsViewModelSpec: QuickSpec {
ParentType.NavItem( ParentType.NavItem(
id: .cancel, id: .cancel,
systemItem: .cancel, systemItem: .cancel,
accessibilityIdentifier: "Cancel button" accessibilityIdentifier: "Cancel"
) )
])) ]))
expect(viewModel.rightNavItems.firstValue()) expect(viewModel.rightNavItems.firstValue())
@ -236,7 +236,7 @@ class ThreadSettingsViewModelSpec: QuickSpec {
ParentType.NavItem( ParentType.NavItem(
id: .done, id: .done,
systemItem: .done, systemItem: .done,
accessibilityIdentifier: "Done button" accessibilityIdentifier: "Done"
) )
])) ]))
} }
@ -369,7 +369,7 @@ class ThreadSettingsViewModelSpec: QuickSpec {
ParentType.NavItem( ParentType.NavItem(
id: .done, id: .done,
systemItem: .done, systemItem: .done,
accessibilityIdentifier: "Done button" accessibilityIdentifier: "Done"
) )
])) ]))
} }

@ -22,6 +22,7 @@ public class ConfirmationModal: Modal {
let explanation: String? let explanation: String?
let attributedExplanation: NSAttributedString? let attributedExplanation: NSAttributedString?
let accessibilityLabel: String? let accessibilityLabel: String?
let accessibilityId: String?
public let stateToShow: State public let stateToShow: State
let confirmTitle: String? let confirmTitle: String?
let confirmAccessibilityLabel: String? let confirmAccessibilityLabel: String?
@ -40,6 +41,7 @@ public class ConfirmationModal: Modal {
explanation: String? = nil, explanation: String? = nil,
attributedExplanation: NSAttributedString? = nil, attributedExplanation: NSAttributedString? = nil,
accessibilityLabel: String? = nil, accessibilityLabel: String? = nil,
accessibilityId: String? = nil,
stateToShow: State = .always, stateToShow: State = .always,
confirmTitle: String? = nil, confirmTitle: String? = nil,
confirmAccessibilityLabel: String? = nil, confirmAccessibilityLabel: String? = nil,
@ -55,6 +57,7 @@ public class ConfirmationModal: Modal {
self.explanation = explanation self.explanation = explanation
self.attributedExplanation = attributedExplanation self.attributedExplanation = attributedExplanation
self.accessibilityLabel = accessibilityLabel self.accessibilityLabel = accessibilityLabel
self.accessibilityId = accessibilityId
self.stateToShow = stateToShow self.stateToShow = stateToShow
self.confirmTitle = confirmTitle self.confirmTitle = confirmTitle
self.confirmAccessibilityLabel = confirmAccessibilityLabel self.confirmAccessibilityLabel = confirmAccessibilityLabel
@ -227,14 +230,19 @@ public class ConfirmationModal: Modal {
info.attributedExplanation == nil info.attributedExplanation == nil
) )
confirmButton.accessibilityLabel = info.confirmAccessibilityLabel confirmButton.accessibilityLabel = info.confirmAccessibilityLabel
confirmButton.accessibilityIdentifier = info.confirmAccessibilityLabel
confirmButton.isAccessibilityElement = true
confirmButton.setTitle(info.confirmTitle, for: .normal) confirmButton.setTitle(info.confirmTitle, for: .normal)
confirmButton.setThemeTitleColor(info.confirmStyle, for: .normal) confirmButton.setThemeTitleColor(info.confirmStyle, for: .normal)
confirmButton.isHidden = (info.confirmTitle == nil) confirmButton.isHidden = (info.confirmTitle == nil)
cancelButton.accessibilityLabel = info.cancelAccessibilityLabel cancelButton.accessibilityLabel = info.cancelAccessibilityLabel
cancelButton.accessibilityIdentifier = info.cancelAccessibilityLabel
cancelButton.isAccessibilityElement = true
cancelButton.setTitle(info.cancelTitle, for: .normal) cancelButton.setTitle(info.cancelTitle, for: .normal)
cancelButton.setThemeTitleColor(info.cancelStyle, for: .normal) cancelButton.setThemeTitleColor(info.cancelStyle, for: .normal)
self.accessibilityLabel = info.accessibilityLabel self.accessibilityLabel = info.accessibilityLabel
self.contentView.accessibilityIdentifier = info.accessibilityId
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {

Loading…
Cancel
Save