SwiftUI Tip: Tracing a Border with Rounded Corners for Buttons and Textual content

With SwiftUI, you’ll be able to simply draw a border round a button or textual content (and it really works for all views) utilizing the border modifier. For instance, you need to create a button like this:

Editor's evaluate : This tutorial has been examined on Xcode 11 beta 6.

We will apply the border modifier to a button object to create a button with a coloured border:

Button (motion: )
Textual content ("Hiya World")
.fontWeight (.daring)
.font (.title)
.foregroundColor (.purple)
.padding()
.border (Colour.purple, width: 5)

[] Orders print "Hiya the button was exchanged!"

. ) {