Charlie Wang
Charlie Wang

Reputation: 97

How do I make a macOS button become highlighted (blue)?

I've tried this:

myButton.highlight(true)

But this only turns the button into a darker blue, which is the "pressed down" state of the button.

Also, the button won't work when I press enter on my keyboard.

How can I make the button highlighted(blue) and togglable when I press enter?

Upvotes: 3

Views: 1645

Answers (1)

ilovecookiez11
ilovecookiez11

Reputation: 333

In Interface Builder, select your button. Then in the sidebar, click on the Identity Inspector and set your button's Keyboard Equivalent to the Return key.

identity inspector

Upvotes: 17

Related Questions