I've got working code in objective c class which is like follows :
closeButton.keyEquivalent = @"\e";
This does not work in swift, as it says "Invalid escape sequence in literal." I've tried to use the following code:
closeButton.keyEquivalent = "\u{53}"
But also no luck. Any ideas ?
You need to assign
closeButton.keyEquivalent = "\u{1b}"
Just tried in a test app.
Edit: According to @Lucasware's comment the ObjC assignment is
[NSString stringWithFormat:@"%C", 0x1b]
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