Can't connect IBAction in Xcode

前端 未结 12 1585

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:26

    I can't speak to the underlying cause--something always seems to be breaking in XCode, but you can always write your IBAction manually, @IBAction func(sender: UIButton) { } in your view/controller and then control-drag from the storyboard element to the action itself. If that doesn't work try linking from the node created by an IBAction in the margin of your code back to the storyboard. This works for me when XCode stops working.

提交回复
热议问题