【发布时间】:2016-11-06 02:56:27
【问题描述】:
我有很多以编程方式创建的按钮,并且可以随时更改。我的点击手势:
let apriVideoGesture = UITapGestureRecognizer(target: self, action: #selector(PrincipaleController.apriVideo(_:)))
cont.addGestureRecognizer(apriVideoGesture)
func apriVideo(sender : UITapGestureRecognizer){
}
如何传递参数?像这样的东西:
let apriVideoGesture = UITapGestureRecognizer(target: self, action: #selector(PrincipaleController.apriVideo(stringa : "ciao")))
cont.addGestureRecognizer(apriVideoGesture)
func apriVideo(sender : UITapGestureRecognizer, stringa : String){
}
抱歉英语不好,我是意大利人
【问题讨论】:
-
不,你不能,但告诉我传递这样的目的,以便我可以告诉你一些替代方案
-
我需要传递一个带有 URL 的字符串。该页面是在服务器接收的一些文章的基础上创建的,我需要在按下的容器的基础上打开特定页面
-
亚历克斯让我回家,我一定会为你做的
-
非常感谢,我很绝望
-
你能告诉我你想创建什么类型的视图,这就是我的想法
标签: swift uitapgesturerecognizer