Compare commits

..

No commits in common. "5a82851fe9df9e01c039d8446c2d2498ca750b04" and "2d45fbbd91c9d31ab25a885b3a5e9344b77e2a68" have entirely different histories.

10 changed files with 3 additions and 132 deletions

View File

@ -236,7 +236,6 @@ struct ComposeAutocompleteEmojisView: View {
CustomEmojiImageView(emoji: emoji)
.frame(height: emojiSize)
}
.accessibilityLabel(emoji.shortcode)
}
} header: {
if !section.isEmpty {
@ -272,7 +271,6 @@ struct ComposeAutocompleteEmojisView: View {
.foregroundColor(Color(UIColor.label))
}
}
.accessibilityLabel(emoji.shortcode)
.frame(height: emojiSize)
}
.animation(.linear(duration: 0.2), value: emojis)
@ -295,7 +293,6 @@ struct ComposeAutocompleteEmojisView: View {
.aspectRatio(contentMode: .fit)
.rotationEffect(expanded ? .zero : .degrees(180))
}
.accessibilityLabel(expanded ? "Collapse" : "Expand")
.frame(width: 20, height: 20)
}

View File

@ -42,8 +42,6 @@ class FastAccountSwitcherViewController: UIViewController {
view.isHidden = true
view.accessibilityViewIsModal = true
view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleTap(_:))))
accountsStack.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(handlePan(_:))))
}
@ -69,16 +67,10 @@ class FastAccountSwitcherViewController: UIViewController {
view.isHidden = false
func completion() {
UIAccessibility.post(notification: .screenChanged, argument: accountViews.first)
}
if UIAccessibility.prefersCrossFadeTransitions {
view.alpha = 0
UIView.animate(withDuration: 0.2, delay: 0, options: [.curveEaseInOut, .allowUserInteraction]) {
self.view.alpha = 1
} completion: { _ in
completion()
}
} else {
let totalDuration: TimeInterval = 0.5
@ -103,8 +95,6 @@ class FastAccountSwitcherViewController: UIViewController {
accountView.transform = .identity
}
}
} completion: { _ in
completion()
}
}
}
@ -124,8 +114,6 @@ class FastAccountSwitcherViewController: UIViewController {
self.view.isHidden = true
completion?()
self.view.removeFromSuperview()
UIAccessibility.post(notification: .screenChanged, argument: nil)
}
}
@ -284,14 +272,6 @@ class FastAccountSwitcherViewController: UIViewController {
super.touchesBegan(touches, with: event)
}
override func accessibilityPerformEscape() -> Bool {
guard !view.isHidden else {
return false
}
hide()
return true
}
}
extension FastAccountSwitcherViewController {

View File

@ -117,8 +117,6 @@ class FastSwitchingAccountView: UIView {
}
updateLabelColors()
isAccessibilityElement = true
}
private func setupAccount(account: LocalData.UserAccountInfo) {
@ -136,16 +134,12 @@ class FastSwitchingAccountView: UIView {
}
}
}
accessibilityLabel = "\(account.username!)@\(account.instanceURL.host!)"
}
private func setupPlaceholder() {
usernameLabel.text = "Add Account"
instanceLabel.isHidden = true
avatarImageView.image = UIImage(systemName: "plus")
accessibilityLabel = "Add Account"
}
private func updateLabelColors() {

View File

@ -296,7 +296,6 @@ class NotificationsTableViewController: DiffableTimelineLikeTableViewController<
completion(true)
}
}
dismissAction.accessibilityLabel = "Dismiss Notification"
dismissAction.image = UIImage(systemName: "clear.fill")
let cellConfiguration = (tableView.cellForRow(at: indexPath) as? TableViewSwipeActionProvider)?.trailingSwipeActionsConfiguration()

View File

@ -222,31 +222,6 @@ class ActionNotificationGroupTableViewCell: UITableViewCell {
updateTimestampWorkItem = nil
}
// MARK: Accessibility
override var accessibilityLabel: String? {
get {
let first = group.notifications.first!
var str = ""
switch group.kind {
case .favourite:
str += "Favorited by "
case .reblog:
str += "Reblogged by "
default:
return nil
}
str += first.account.displayNameWithoutCustomEmoji
if group.notifications.count > 1 {
str += " and \(group.notifications.count - 1) more"
}
str += ", \(first.createdAt.formatted(.relative(presentation: .numeric))), "
str += statusContentLabel.text ?? ""
return str
}
set {}
}
}
extension ActionNotificationGroupTableViewCell: SelectableTableViewCell {

View File

@ -186,22 +186,6 @@ class FollowNotificationGroupTableViewCell: UITableViewCell {
updateTimestampWorkItem = nil
}
// MARK: Accessibility
override var accessibilityLabel: String? {
get {
let first = group.notifications.first!
var str = "Followed by "
str += first.account.displayNameWithoutCustomEmoji
if group.notifications.count > 1 {
str += " and \(group.notifications.count - 1) more"
}
str += ", \(first.createdAt.formatted(.relative(presentation: .numeric)))"
return str
}
set {}
}
}
extension FollowNotificationGroupTableViewCell: SelectableTableViewCell {

View File

@ -135,29 +135,6 @@ class FollowRequestNotificationTableViewCell: UITableViewCell {
self.stackView.addArrangedSubview(label)
}
// MARK: Accessibility
override var accessibilityLabel: String? {
get {
guard let notification else { return nil }
var str = "Follow requested by "
str += notification.account.displayNameWithoutCustomEmoji
str += ", \(notification.createdAt.formatted(.relative(presentation: .numeric)))"
return str
}
set {}
}
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
get {
return [
UIAccessibilityCustomAction(name: "Accept Request", target: self, selector: #selector(acceptButtonPressed)),
UIAccessibilityCustomAction(name: "Reject Request", target: self, selector: #selector(acceptButtonPressed)),
]
}
set {}
}
// MARK: - Interaction
@IBAction func rejectButtonPressed() {

View File

@ -55,7 +55,7 @@
<rect key="frame" x="0.0" y="0.0" width="115" height="26.5"/>
<accessibility key="accessibilityConfiguration" label="Accept Request"/>
<state key="normal" title=" Accept" image="checkmark.circle.fill" catalog="system">
<color key="titleColor" systemColor="tintColor"/>
<color key="titleColor" systemColor="systemBlueColor"/>
</state>
<connections>
<action selector="acceptButtonPressed" destination="Pcu-ap-Xqf" eventType="touchUpInside" id="hGw-3d-RNi"/>
@ -64,7 +64,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" pointerInteraction="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7MW-rY-m5l">
<rect key="frame" x="115" y="0.0" width="115" height="26.5"/>
<state key="normal" title=" Reject" image="xmark.circle.fill" catalog="system">
<color key="titleColor" systemColor="tintColor"/>
<color key="titleColor" systemColor="systemBlueColor"/>
</state>
<connections>
<action selector="rejectButtonPressed" destination="Pcu-ap-Xqf" eventType="touchUpInside" id="EP6-Bg-3nC"/>
@ -111,7 +111,7 @@
<systemColor name="secondaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="tintColor">
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>

View File

@ -93,25 +93,6 @@ class PollFinishedTableViewCell: UITableViewCell {
updateTimestampWorkItem = nil
}
// MARK: Accessibility
override var accessibilityLabel: String? {
get {
guard let notification else { return nil }
var str = "Poll from "
str += notification.account.displayNameWithoutCustomEmoji
str += " finished "
str += notification.createdAt.formatted(.relative(presentation: .numeric))
if let poll = notification.status?.poll,
poll.options.contains(where: { ($0.votesCount ?? 0) > 0 }) {
let winner = poll.options.max(by: { ($0.votesCount ?? 0) < ($1.votesCount ?? 0) })!
str += ", winning option: \(winner.title)"
}
return str
}
set {}
}
}
extension PollFinishedTableViewCell: SelectableTableViewCell {

View File

@ -85,22 +85,6 @@ class StatusUpdatedNotificationTableViewCell: UITableViewCell {
updateTimestampWorkItem = nil
}
// MARK: Accessibility
override var accessibilityLabel: String? {
get {
guard let notification else { return nil }
var str = "Post from "
str += notification.account.displayNameWithoutCustomEmoji
str += " edited "
str += notification.createdAt.formatted(.relative(presentation: .numeric))
str += ", "
str += contentLabel.text ?? ""
return str
}
set {}
}
}
extension StatusUpdatedNotificationTableViewCell: SelectableTableViewCell {