Merge pull request #544 from j-f1/account-header-a11y

Add accessibility labels to the profile navigation bar
This commit is contained in:
Marcus Kida 2022-11-14 15:43:32 +01:00 committed by GitHub
commit 7a3039570a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,7 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
action: #selector(ProfileViewController.settingBarButtonItemPressed(_:)) action: #selector(ProfileViewController.settingBarButtonItemPressed(_:))
) )
barButtonItem.tintColor = .white barButtonItem.tintColor = .white
barButtonItem.accessibilityLabel = L10n.Common.Controls.Actions.settings
return barButtonItem return barButtonItem
}() }()
@ -62,6 +63,7 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
action: #selector(ProfileViewController.shareBarButtonItemPressed(_:)) action: #selector(ProfileViewController.shareBarButtonItemPressed(_:))
) )
barButtonItem.tintColor = .white barButtonItem.tintColor = .white
barButtonItem.accessibilityLabel = L10n.Common.Controls.Actions.share
return barButtonItem return barButtonItem
}() }()
@ -73,6 +75,7 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
action: #selector(ProfileViewController.favoriteBarButtonItemPressed(_:)) action: #selector(ProfileViewController.favoriteBarButtonItemPressed(_:))
) )
barButtonItem.tintColor = .white barButtonItem.tintColor = .white
barButtonItem.accessibilityLabel = L10n.Scene.Favorite.title
return barButtonItem return barButtonItem
}() }()
@ -84,18 +87,21 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
action: #selector(ProfileViewController.bookmarkBarButtonItemPressed(_:)) action: #selector(ProfileViewController.bookmarkBarButtonItemPressed(_:))
) )
barButtonItem.tintColor = .white barButtonItem.tintColor = .white
barButtonItem.accessibilityLabel = L10n.Scene.Bookmark.title
return barButtonItem return barButtonItem
}() }()
private(set) lazy var replyBarButtonItem: UIBarButtonItem = { private(set) lazy var replyBarButtonItem: UIBarButtonItem = {
let barButtonItem = UIBarButtonItem(image: UIImage(systemName: "arrowshape.turn.up.left"), style: .plain, target: self, action: #selector(ProfileViewController.replyBarButtonItemPressed(_:))) let barButtonItem = UIBarButtonItem(image: UIImage(systemName: "arrowshape.turn.up.left"), style: .plain, target: self, action: #selector(ProfileViewController.replyBarButtonItemPressed(_:)))
barButtonItem.tintColor = .white barButtonItem.tintColor = .white
barButtonItem.accessibilityLabel = L10n.Common.Controls.Actions.reply
return barButtonItem return barButtonItem
}() }()
let moreMenuBarButtonItem: UIBarButtonItem = { let moreMenuBarButtonItem: UIBarButtonItem = {
let barButtonItem = UIBarButtonItem(image: UIImage(systemName: "ellipsis.circle"), style: .plain, target: nil, action: nil) let barButtonItem = UIBarButtonItem(image: UIImage(systemName: "ellipsis.circle"), style: .plain, target: nil, action: nil)
barButtonItem.tintColor = .white barButtonItem.tintColor = .white
barButtonItem.accessibilityLabel = L10n.Common.Controls.Actions.seeMore
return barButtonItem return barButtonItem
}() }()