Ive been trying to search online and in my "book" to found a conclusive answer, but haven't been able to. I am working with an UIImageView and want to connect it to an IBAction. When Ctrl-dragging to my correlating VC.m, it won't let me. I then tried to go under attributes inspector and tick the "User Interaction Enabled" checkbox, AND under the identity inspector I checked traits checkbox for Button. Shouldn't this make my element/control be able to connect to an action? Digging a little further I was reading about passive, active and static controls, but I got the notion that you should be able to connect an action to any control the user interacts with, since they all inherit from UIControl.
Any enlightenment very much appreciated.
(I also tried with a few other elements, but I seem to be able able to connect the action working with a button)
A
UIImageView
does not inherit fromUIControl
. If you want to perform an action when the user touches your image then you will need to add aUIGestureRecognizer
to it.