36 lines
979 B
Swift
36 lines
979 B
Swift
//
|
|
// MainControllerInvite.swift
|
|
// Wallet
|
|
//
|
|
// Created by Igor on 29.03.2021.
|
|
// Copyright © 2021 AM. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class MainControllerInvite: UIViewController {
|
|
|
|
@IBOutlet private weak var qrImgView: UIImageView!
|
|
@IBOutlet private weak var linkLbl: UILabel!
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
self.title = L10n.Main.Invite.title
|
|
self.linkLbl.lzText = "https://malinka.app.link"
|
|
self.qrImgView.image = self.linkLbl.text?.generateQRCode()
|
|
}
|
|
|
|
@IBAction func onShare(_: AnyObject?) {
|
|
guard let url = URL(string: linkLbl.text ?? "") else { return }
|
|
|
|
let ctrl = UIActivityViewController(activityItems: [url], applicationActivities: nil)
|
|
ctrl.popoverPresentationController?.sourceView = view
|
|
self.present(ctrl, animated: true)
|
|
}
|
|
|
|
@IBAction func onCopy(_: AnyObject?) {
|
|
Alert.copy(self.linkLbl.text)
|
|
}
|
|
|
|
}
|