Files
raspberry/iOS/Wallet/Sources/AccountOnboarding/Controller/AccountOnboardingControllerStartWay.swift
T
2022-10-06 16:17:16 +03:00

68 lines
2.3 KiB
Swift

//
// AccountOnboardingControllerStartWay.swift
// Wallet
//
// Created by Saveliy Stavitsky on 2/16/21.
// Copyright © 2021 AM. All rights reserved.
//
import UIKit
import WalletKit
class AccountOnboardingControllerStartWay: UIViewController {
@IBOutlet var privateKeyView: UIView!
@IBOutlet var linkView: UIView!
@IBOutlet var buyAccountView: UIView!
@IBOutlet var buyAccountPriceLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
buyAccountView.isHidden = false
buyAccountPriceLabel.isHidden = true
linkView.isHidden = true
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
navigationController?.navigationBar.isTranslucent = true
for view in [privateKeyView, linkView] {
view?.layer.borderWidth = 1.0
view?.layer.borderColor = Asset.marble.color.cgColor
}
}
@IBAction func privateKeyPressed(_ sender: Any) {
AccountViewAuthorize.showGetPassword(in: self) { _ in
let manualController = StoryboardScene.Account.manual.instantiate()
manualController.privateKeyHasBeenProcessed = { [weak self] in self?.navigationController?.popViewController(animated: true)
}
self.navigationController?.pushViewController(manualController, animated: true)
}
}
@IBAction func linkPressed(_ sender: Any) {
// UIApplication.shared.open(URL(string: "https://myeoswallet.net/resources")!)
}
@IBAction private func onCreateWallet() {
Task {
do {
let vc = try await AttestateWalletService.createController()
DispatchQueue.main.async {
self.navigationController?.pushViewController(vc, animated: true)
}
} catch {
Popup.show(title: "account.create.error.title".localized,
description: "account.create.error.description".localized,
submit: "account.create.error.button.title".localized,
submitStyle: .primary) { ctrl in
ctrl.dismiss(animated: true, completion: nil)
}
}
}
}
}