我的应用程序目前有两个按钮。一个链接到Twitter页面,另一个链接到我网站上的页面。它们都位于相同的视图控制器和相同的视图上。然而,当我点击反馈按钮时,它就会转到我的Twitter上。有什么建议吗?
这是我的密码。
import UIKit
class AboutScreenViewController: UIViewController {
@IBAction func twitterButton(_ sender: Any) {
if let url2 = URL(string: "https://twitter.com/SunnyParks4u") {
UIApplication.shared.open(url2, options: [:], completionHandler: nil)
}
}
@IBAction func FeedbackButton(_ sender: Any) {
if let Contactlink = URL(string: "https://sunnyparks4u.wixsite.com/home-page/contact-8") {
UIApplication.shared.open(Contactlink, options: [:], completionHandler: nil)
}
}
override func viewDidLoad() {
super.viewDidLoad()
}
}发布于 2022-07-04 12:49:42
也许您在接口构建器中复制/粘贴了按钮,现在这两个按钮执行相同的IBAction。
右击两个按钮并检查

https://stackoverflow.com/questions/72823427
复制相似问题