gpt4 book ai didi

swift - 如何将值从一个选项卡 View 项传递给其他项?

转载 作者:行者123 更新时间:2023-11-28 13:30:11 27 4
gpt4 key购买 nike

<分区>

我在新闻标签中有一个按钮,我想通过任何方式将值传递给竞争标签。

但问题是没有传递正确的值。

我的代码是-

//新闻 View Controller

@IBAction func fullStndngAction(_ sender: Any) {
//I Tried this
let prefs = UserDefaults.standard
prefs.set(true, forKey: "isFromNewsView")

//I Tried This as well
let whereFrom = storyboard?.instantiateViewController(withIdentifier: "LatestNewsDetailViewController") as? LatestNewsDetailViewController
whereFrom!.isFromNewsView = true

self.tabBarController?.selectedIndex = 1

}

但我总是在竞争观点上变得错误。

图片描述-

enter image description here

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