Blame view
App/createNew/VCNhapTenCtruong.swift
1.22 KB
d774f0637
|
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 35 36 37 38 39 40 |
import UIKit class VCNhapTenCtruong: UIViewController { @IBOutlet weak var edtTitle: UITextField! @IBOutlet weak var topMargin: NSLayoutConstraint! static func getInstance() -> VCNhapTenCtruong { let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCNhapTenCtruong") as! VCNhapTenCtruong return vcOpen } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) edtTitle.text = getVcRoot()?.tenCtruong } @IBAction func btnLeftClick(_ sender: Any) { getVcRoot()?.tenCtruong = edtTitle.text _ = getVcRoot()?.changeCurrentController(VCNhapTenCty.getInstance()) } @IBAction func btnRightClick(_ sender: Any) { getVcRoot()?.tenCtruong = edtTitle.text _ = getVcRoot()?.changeCurrentController(VCNhapMucChup.getInstance()) } @IBAction func edtActionTrigerClick(_ sender: Any) { edtTitle.endEditing(true) } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) } func getVcRoot() -> VCRootCreateNew? { return self.parent as? VCRootCreateNew } } |