0
我在爲UIButton方法addTarget的問題掙扎。在沒有用戶交互的情況下調用addTarget中的UIButton選擇器
spotifyButton.socialButton.addTarget(self, action: Selector(Social.openUrl(Constants.URLs.SpotifyApp, fallback: Constants.URLs.SpotifyWeb)), forControlEvents: .TouchUpInside)
此代碼是內部一個UIViewController的viewDidLoad中的問題是,選擇器內部的方法被調用,而不用戶交互。 你能幫我解決這個問題嗎? 謝謝