将变量从嵌入式视图控制器传递到容器视图控制器,并且在更新容器之后,容器将更新父视图控制器
@IBAction func updateLabel(_ sender: Any) {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "ContViewController") as! ContViewController
vc.labelName.text = textFieldValue.text
navigationController?.popViewController(animated: true)
dismiss(animated: true, completion: nil)
}
所有新学习者都尝试过这个,我理解但没有成功,因此任何人都可以帮助我