Can't connect IBAction in Xcode

前端 未结 12 1559

When I drag from a button on the storyboard to my view controller Swift file, I only get the option to insert an Outlet or Outlet Collection.

Similarly, if I create the

12条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 13:11

    You can try to change the @IBAction's argument from (_ sender: Any) to (_ sender: UIButton) or (_ sender: AnyObject), but manually.

    It might work.

提交回复
热议问题