gpt4 book ai didi

ios - UITapGestureRecognizer 没有打开 url

转载 作者:行者123 更新时间:2023-11-29 01:15:49 26 4
gpt4 key购买 nike

我在点击图像以在导航器中打开 URL 时创建了一个 Action ,但是当我点击它时,没有打开任何东西。这是我的代码:

@IBAction func Anuncio(sender: UITapGestureRecognizer) {

if let url = NSURL(string: "http://capturando.es/") {
UIApplication.sharedApplication().openURL(url)

}
}

最佳答案

检查一次 yourImagename.userInteractionEnabled = truefalse 如果为 false,则启用一次,之后所有其他功能都会自动触发

yourImagename.userInteractionEnabled  = true

关于ios - UITapGestureRecognizer 没有打开 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35198527/

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