[英]Connecting UISwitch in Storyboard to preexisting Outlet and IBAction
[英]Connecting buttons in main storyboard to @IBAction func operate() in ViewController
您可以通過右鍵單擊按鈕來檢查按鈕所連接的插座。 要將按鈕連接到動作,請在按住該控件的同時單擊並從按鈕拖動到要附加到該動作的動作。
在Swift 3中,您想要將@IBAction
的參數從默認(_ sender: Any)
更改為(_ sender: UIButton)
或(_ sender: AnyObject)
,但是要手動進行。
它可能會起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.