Can't connect IBAction in Xcode

前端 未结 12 1718

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

    This bug is indeed super crazy. I lost hours because of it. Until now I found 2 reasons, and I'll post here maybe somebody will read and be helpful:

    1. If anybody is using BonMot pod, this is one possible cause. If you remove it, the IBAction will be back.

    2. Any extension on UIButton or UIBarButtonItem can cause this as well. Comment the extension, and the IBAction will be back. Happy coding.


    UPDATE: BonMot fixed this issue in 4.0.2

提交回复
热议问题