How to use a UIButton as a toggle switch
<p>I am using a UIButton of custom type and what I want is use it like a toggle switch with the change of image. Like when it is clicked if previously it was not in selected mode it should go in selected mode or otherwise vice-a-versa. Also it will have a different image and when it is selected it will have a different image when it is not.</p>

<p>I am not able to do it programatically, is there any good easy way to do this.</p>
