gpt4 book ai didi

ios - 为什么没有在我的 UITabBarItem 上调用 didSelectItem?

转载 作者:行者123 更新时间:2023-11-28 08:34:42 26 4
gpt4 key购买 nike

如何选择标签栏上的项目?

这是我的代码

@IBOutlet var tabBar: UITabBar!
@IBOutlet var item: UITabBarItem!
func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) {
if item.tag == 0 {
print("if this worktap 1")

let vc = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
vc.setInitialText("Look at this !")
vc.addURL(NSURL(string: "https://link.com"))
presentViewController(vc, animated: true, completion: nil)
}
else {
// code
print("if this work tap 2")
}
}

但是当我点击一个项目时没有任何反应。

最佳答案

关于ios - 为什么没有在我的 UITabBarItem 上调用 didSelectItem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38127176/

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