Question: I got a UIButton with style "Info Dark" set up in interface builder in my iPhone 4 app. One of the properties of the button is "Highlighted", which displays a white highlight around the button.

I would like to toggle this white highlight on and off, indicating if the button function is active or not. 

The button is linked for "Touch up inside" event in the interface builder with this callback:

```
infoButton.highlighted = !infoButton.highlighted;

```

After the first touch, the highlight disappears and does not toggle as I expect it to. What else do I need to do to make the highlight toggle and display the state of the button?

Thank you!

**Update:**
When loaded from the interface builder, the button stays highlighted, even as the view appears/disappears. What causes this to happen is the "shows touch on highlight" interface builder property. If I assign the code above to another button, the info button highlights on and off as expected. However, the touches of the info button itself interfere with the above code, causing the button to lose the **"touch" highlight**

Update 2: I added another info button, directly below the first info button, in the interface builder and made it glow permanently. To create the appearance of the toggle, I hide and unhide the glowInfoButton below the real one. This works as expected:

```
    infoButton.highlighted = NO;
    glowInfoButton.highlighted = YES;
    glowInfoButton.enabled = NO;
    glowInfoButton.hidden = YES;

- (IBAction)toggleInfoMode:(id)sender {
//    infoButton.selected = !infoButton.selected;
    glowInfoButton.hidden = !glowInfoButton.hidden;
 }

```

Answer: 
The highlighted property doesn't work like that, buttons aren't toggles.

It's just to know if the button is being pressed, if I'm correct.

If you want to implement that functionality, I recommend you subclass UIButton or UIControl.
The highlighted state of a UIButton is simply setting the button's alpha to 0.5f. So if you set the button to not change on highlight, then just toggle the alpha between 0.1 and 0.5.

For example:

```
- (void)buttonPressed:(id)sender {

    if((((UIButton*)sender).alpha) != 1.0f){

        [((UIButton*)sender) setAlpha:1.0f];
    } else {
        [((UIButton*)sender) setAlpha:0.5f];
    }

}

```