Blame view

App/createNew/VCNhapTenCty.swift 1.02 KB
d774f0637   Trịnh Văn Quân   fisrt comit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  import UIKit
  
  class VCNhapTenCty: UIViewController {
      @IBOutlet weak var edtTenCty: UITextField!
      @IBOutlet weak var topMargin: NSLayoutConstraint!
  
      static func getInstance() -> VCNhapTenCty {
          let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
          let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCNhapTenCty") as! VCNhapTenCty
          return vcOpen
      }
  
      override func viewWillAppear(_ animated: Bool) {
          super.viewWillAppear(animated)
          edtTenCty.text = getVcRoot()?.tenCty
      }
  
      @IBAction func btnLeftClick(_ sender: Any) {
          getVcRoot()?.dismiss(animated: true)
      }
  
      @IBAction func btnRightClick(_ sender: Any) {
          getVcRoot()?.tenCty = edtTenCty.text
          _ = getVcRoot()?.changeCurrentController(VCNhapTenCtruong.getInstance())
      }
  
      @IBAction func edtActionTrigerClick(_ sender: Any) {
          edtTenCty.endEditing(true)
      }
  
      func getVcRoot() -> VCRootCreateNew? {
          return self.parent as? VCRootCreateNew
      }
  }