gpt4 book ai didi

ios - 更改 View + 以编程方式将变量发送到 View

转载 作者:行者123 更新时间:2023-11-28 12:28:35 24 4
gpt4 key购买 nike

我有一个函数可以正确更改 View ,但它不会将变量传递到下一个 View 。我真的不是 Swift 专家,我不知道我的代码错误在哪里:

let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let newViewController = storyBoard.instantiateViewController(withIdentifier: "PaymentVC") as! PaymentViewController
self.present(newViewController, animated: true, completion: nil)
newViewController.num_pal = num_words
newViewController.l_origen = l_source
newViewController.l_destino = l_target
newViewController.espec = espec
newViewController.user = user
newViewController.pass = pass
newViewController.texto = texto
newViewController.modificado = modificado
newViewController.texto_ant = texto_ant

非常感谢您的帮助。

最佳答案

self.present(newViewController, animated: true, completion: nil)应该是传数据之后,放在newViewController.texto_ant = texto_ant之后就可以了p>

关于ios - 更改 View + 以编程方式将变量发送到 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42693553/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com