In my view I want to add a target which should be fired when I click the view. I can do the same through IB or I have done it for buttons even in code. However I have no idea how to do it for UIView programatically.
Anyone has done that before.
Help me.
For clicking a
UIViewyou have to useUIGestureRecognizerorUITouch. This would only help in prompting an action. TheUIButtonhas a selector method whereas the UIView does not have any such method. Also , this is same forUIImageViewsetc also.