From 533a1d1830f2d3d6027bac3e2cc7e585ae23659e Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Wed, 3 Feb 2021 13:10:12 -0800 Subject: [PATCH] Add copy text VoiceOver action --- Localizations/Localizable.strings | 1 + Views/UIKit/Content Views/StatusView.swift | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Localizations/Localizable.strings b/Localizations/Localizable.strings index 7a08b05..d5c29f6 100644 --- a/Localizations/Localizable.strings +++ b/Localizations/Localizable.strings @@ -3,6 +3,7 @@ "about" = "About"; "about.acknowledgments" = "Acknowledgments"; "accessibility.activate-link-%@" = "Activate link: %@"; +"accessibility.copy-text" = "Copy text"; "account.%@-followers" = "%@'s Followers"; "account.accept-follow-request-button.accessibility-label" = "Accept follow request"; "account.avatar.accessibility-label-%@" = "Avatar: %@"; diff --git a/Views/UIKit/Content Views/StatusView.swift b/Views/UIKit/Content Views/StatusView.swift index f6f649c..72b11de 100644 --- a/Views/UIKit/Content Views/StatusView.swift +++ b/Views/UIKit/Content Views/StatusView.swift @@ -755,6 +755,15 @@ private extension StatusView { return true }) + actions.append( + UIAccessibilityCustomAction( + name: NSLocalizedString("accessibility.copy-text", + comment: "")) { [weak self] _ in + UIPasteboard.general.string = self?.bodyView.contentTextView.text + + return true + }) + actions.append(contentsOf: bodyView.accessibilityCustomActions ?? []) if menuButton.isEnabled {