Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the form's default button in Xcode?

In a OS X app, if I have a form with a couple of buttons, how do I nominate a default button for the form? By default button I mean the button that acts when I hit Enter.

I've been trying to learn Swift, and so I've been experimenting building little OS X apps using Xcode 6.

All my programming experience is in Windows desktop applications, so I might be looking at this all wrong, and maybe using the wrong terminology here.

like image 246
alondono Avatar asked Dec 15 '22 20:12

alondono


1 Answers

Set they button's key equivalent to \r. This is most easily done in Interface Builder by selecting "Key Equivalent" and pressing Enter.

enter image description here

like image 64
Rob Napier Avatar answered Dec 27 '22 05:12

Rob Napier