I'm making a form in Xcode using objective-c and cocoa. In the interface builder I have 2 textfields and 2 buttons. When I build the project and run it, neither of the two buttons are selected (highlighted in blue as opposed to white). When the user is writing in the text field the ENTER key needs to trigger one of the buttons to be pressed.
How do I do this?
swift in your assistant editor. You can do this by holding Option on your keyboard and clicking the ViewController. swift file in your Project Navigator. Now click on the button, hold CTRL and then drag it to your Swift file.
You set the Key Equivalent value for your button in IB. Just click on that field in the attributes inspector and press the enter key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With