|
@@ -43,6 +43,14 @@ class QrViewController: UIViewController {
|
|
|
title = String.localized("qrshow_title")
|
|
|
setupSubviews()
|
|
|
view.backgroundColor = DcColors.defaultBackgroundColor
|
|
|
+
|
|
|
+ let image: UIImage?
|
|
|
+ if #available(iOS 13.0, *) {
|
|
|
+ image = UIImage(systemName: "ellipsis.circle")
|
|
|
+ } else {
|
|
|
+ image = UIImage(named: "ic_more")
|
|
|
+ }
|
|
|
+ self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style: .plain, target: self, action: #selector(showMoreOptions))
|
|
|
}
|
|
|
|
|
|
override func viewDidDisappear(_ animated: Bool) {
|
|
@@ -71,4 +79,15 @@ class QrViewController: UIViewController {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+ // MARK: - actions
|
|
|
+ @objc private func showMoreOptions() {
|
|
|
+ let alert = UIAlertController(title: String.localized("qrshow_title"), message: nil, preferredStyle: .safeActionSheet)
|
|
|
+ alert.addAction(UIAlertAction(title: String.localized("menu_copy_to_clipboard"), style: .default, handler: copyToClipboard(_:)))
|
|
|
+ alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))
|
|
|
+ self.present(alert, animated: true, completion: nil)
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func copyToClipboard(_ action: UIAlertAction) {
|
|
|
+ UIPasteboard.general.string = dcContext.getSecurejoinQr(chatId: chatId)
|
|
|
+ }
|
|
|
}
|