I have a dialog with 1 or more buttons and want to be able to programmatically set the rightmost one be the default one, so that when the user presses the Enter or Return key it
For Swift 4.2 just use
button.isHighlighted = true