Jarosław Krajewski Jarosław Krajewski - 1 month ago 14
Swift Question

Can't drag button action to existing function in Xcode 8

I have a weird issue with Xcode 8. When I try to ctrl + drag button to existing function, I can't I can only create new outlet or Action. What is more weird, that even when I create action by ctrl + drag i can't connect event the same button that I used for creating action. IB icon is also blank like there is no connection between action and button, but real time clicking runs action.
On the other hand when I try to connect action to button from swift to storyboard I can (@IB icon becomes "full"), but then I get exception on real time clicking unrecognized selector myActionWithSender
enter image description here
enter image description here

Answer

To fix it, I had to update my project language to Swift 3.0 from Swift 2.3