|
@@ -63,6 +63,14 @@ class QrPageController: UIPageViewController {
|
|
|
animated: true,
|
|
|
completion: nil
|
|
|
)
|
|
|
+
|
|
|
+ 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 viewWillAppear(_ animated: Bool) {
|
|
@@ -94,6 +102,17 @@ class QrPageController: UIPageViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @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: 0)
|
|
|
+ }
|
|
|
+
|
|
|
// MARK: - factory
|
|
|
private func makeQRReader() -> QrCodeReaderController {
|
|
|
let qrReader = QrCodeReaderController()
|