swift 将数据从ViewController传递到另一个

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swift 将数据从ViewController传递到另一个相关的知识,希望对你有一定的参考价值。

//Section 13, Lecture 156

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "sceondScreen" {
        
        let destinationVC = segue.destination as! SecondViewController
        
        destinationVC.data = data
        
    }
}

以上是关于swift 将数据从ViewController传递到另一个的主要内容,如果未能解决你的问题,请参考以下文章