VCNhapTenCty.swift
1.02 KB
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
}
}