VoiceOver: Add show profile rotor action to timeline statuses
Closes #285
This commit is contained in:
parent
df07fa85d5
commit
19bf6cbf18
|
@ -429,10 +429,16 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
||||||
|
|
||||||
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
||||||
get {
|
get {
|
||||||
guard let text = contentTextView.attributedText else {
|
guard let text = contentTextView.attributedText,
|
||||||
|
let status = mastodonController.persistentContainer.status(for: statusID) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var actions: [UIAccessibilityCustomAction] = []
|
var actions = [
|
||||||
|
UIAccessibilityCustomAction(name: "Show \(status.account.displayNameWithoutCustomEmoji)", actionHandler: { [unowned self] _ in
|
||||||
|
self.delegate?.selected(account: status.account.id)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
]
|
||||||
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
||||||
guard let value = value as? URL else {
|
guard let value = value as? URL else {
|
||||||
return
|
return
|
||||||
|
|
|
@ -310,10 +310,16 @@ class TimelineStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
|
|
||||||
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
|
||||||
get {
|
get {
|
||||||
guard let text = contentTextView.attributedText else {
|
guard let text = contentTextView.attributedText,
|
||||||
|
let status = mastodonController.persistentContainer.status(for: statusID) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var actions: [UIAccessibilityCustomAction] = []
|
var actions = [
|
||||||
|
UIAccessibilityCustomAction(name: "Show \(status.account.displayNameWithoutCustomEmoji)", actionHandler: { [unowned self] _ in
|
||||||
|
self.delegate?.selected(account: status.account.id)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
]
|
||||||
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
text.enumerateAttribute(.link, in: NSRange(location: 0, length: text.length)) { value, range, stop in
|
||||||
guard let value = value as? URL else {
|
guard let value = value as? URL else {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue