SwiftUI, Blue Default Button

SwiftUI allows you to easily create buttons with default iOS and macOS styles. These are great and fit in well with the rest of the Apple ecosystem. However, SwiftUI does not allow you to easily change the color of these buttons. In fact, to have any sort of special colored button, you have to create your own special button style.

If you want a standard SwiftUI element, but have it be blue, like most "confirm" buttons in the Apple ecosystem you simply need to add a .keyboardShortcut(.defaultAction) modifier to it. This modifier makes the Button a primary button and turns it blue by default. You get to keep all the other great features of built in button styling.

The above modifier is like adding a keyEquivalent on Return to the button.