GenerateBlankVC.swift 1.56 KB
//
//  GenerateBlankVC.swift
//  Twear
//
//  Created by yangbin on 2022/2/12.
//

import UIKit

class GenerateBlankVC: UIViewController {
    @IBOutlet weak var label: UILabel!
    var count: Int = 0
    override func viewDidLoad() {
        super.viewDidLoad()
        title = LocString("生成空白模拟卡")
        
        GCDTimer.shared.scheduledDispatchTimer(WithTimerName: "GenerateBlankNFC", timeInterval: 1, queue: .main, repeats: true) {[weak self] in
            self?.loading()
        }
        // Do any additional setup after loading the view.
    }
    
    func loading() {
        count += 1
        label.text = "\(LocString("正在生成..."))\(count*20)%"
        if count == 5 {
            GCDTimer.shared.cancleTimer(WithTimerName: "GenerateBlankNFC")
            self.showAlert(title: LocString("详情"), message: LocString("请找管理员写入数据,否则将会影响使用"), confirmText: LocString("知道了"), cancelText: nil, confirm: {[weak self] action in
                let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Setting", identifier: "NFCMessageVC")
                self?.navigationController?.pushViewController(vc, animated: true)
            })
        }
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}