mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Update ScanQRCodeWrapperVC for multi device QR code scanning
This commit is contained in:
parent
4afeba866b
commit
ade1fc3239
|
@ -81,7 +81,8 @@ final class NewConversationVC : OWSViewController, OWSQRScannerDelegate {
|
|||
@objc private func scanQRCode() {
|
||||
ows_ask(forCameraPermissions: { [weak self] hasCameraAccess in
|
||||
if hasCameraAccess {
|
||||
let scanQRCodeWrapperVC = ScanQRCodeWrapperVC()
|
||||
let message = NSLocalizedString("Scan the QR code of the person you'd like to securely message. They can find their QR code by going into Loki Messenger's in-app settings and clicking \"Show QR Code\".", comment: "")
|
||||
let scanQRCodeWrapperVC = ScanQRCodeWrapperVC(message: message)
|
||||
scanQRCodeWrapperVC.delegate = self
|
||||
self?.navigationController!.pushViewController(scanQRCodeWrapperVC, animated: true)
|
||||
} else {
|
||||
|
|
|
@ -1,12 +1,26 @@
|
|||
|
||||
final class ScanQRCodeWrapperVC : UIViewController {
|
||||
var delegate: (UIViewController & OWSQRScannerDelegate)? = nil
|
||||
private let message: String
|
||||
private let scanQRCodeVC = OWSQRCodeScanningViewController()
|
||||
|
||||
// MARK: Settings
|
||||
override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .portrait }
|
||||
|
||||
// MARK: Lifecycle
|
||||
init(message: String) {
|
||||
self.message = message
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
preconditionFailure("Use init(title:) instead.")
|
||||
}
|
||||
|
||||
override init(nibName: String?, bundle: Bundle?) {
|
||||
preconditionFailure("Use init(title:) instead.")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
// Background color
|
||||
view.backgroundColor = Theme.backgroundColor
|
||||
|
@ -27,7 +41,7 @@ final class ScanQRCodeWrapperVC : UIViewController {
|
|||
bottomView.pin(.bottom, to: .bottom, of: view)
|
||||
// Explanation label
|
||||
let explanationLabel = UILabel()
|
||||
explanationLabel.text = NSLocalizedString("Scan the QR code of the person you'd like to securely message. They can find their QR code by going into Loki Messenger's in-app settings and clicking \"Show QR Code\".", comment: "")
|
||||
explanationLabel.text = message
|
||||
explanationLabel.textColor = Theme.primaryColor
|
||||
explanationLabel.font = .ows_dynamicTypeSubheadlineClamped
|
||||
explanationLabel.numberOfLines = 0
|
||||
|
|
Loading…
Reference in a new issue