iPhone toggle button implementation
<p>I would like to create a toggle button in my iPhone application. However, I don't know exactly what would be the best approach for this.</p>

<p>I am considering two options.</p>

<p>I could subclass an UIButton. That way I do not have to implement touch handling. I could just create a method that returns a boolean indicating whether the button is in on or off state.</p>

<p>I could also start with an UIView subclass and create it from scratch. I suppose it would be easier to do things like a transition animation, but I would have to create my own touch handling.</p>

<p>What do you think is the best one? Or would you know a better way? (Maybe there is an open-source/free view available on the web?)</p>

<p><strong>EDIT:</strong> I don't want to use the UISwitch because I want my toggle button to look like that. I want it to be a big rectangular button and make the background change to indicate the state.</p>

<p>Thanks!</p>
