Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Xcode中的标签是否可以单击到其他页面?_Ios_Swift_Xcode - Fatal编程技术网

Ios Xcode中的标签是否可以单击到其他页面?

Ios Xcode中的标签是否可以单击到其他页面?,ios,swift,xcode,Ios,Swift,Xcode,我想做的是点击标签,它将导致另一个页面。现在我正在使用Xcode制作iOS应用程序。我在网上找到了这方面的信息,但找不到相关信息 我该怎么做?您可以在标签上添加并触发点击操作。您可以添加如下点击手势: let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapOnLabel(gesure:))) YOUR_Label.addGestureRecognizer(tapGesture) func

我想做的是点击标签,它将导致另一个页面。现在我正在使用Xcode制作iOS应用程序。我在网上找到了这方面的信息,但找不到相关信息


我该怎么做?

您可以在标签上添加并触发点击操作。

您可以添加如下点击手势:

 let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapOnLabel(gesure:)))
 YOUR_Label.addGestureRecognizer(tapGesture)

 func didTapOnLabel(gesure:UITapGestureRecognizer){
    //handle your action here
  }

你能展示一下你的尝试吗?我们不必为您编写代码。使用
UIButton
…Tj3n,谢谢,我遵循您的答案,可以随时在此链接上查看答案的副本