Dotted Line Border

How can I create a rectangle with a dotted line border? I want to create a “ghost-like” button which is secondary and optional to the app’s main functionality. Hopefully there is a SwiftUI option already.

Thank you!

try this:

struct ContentView: View {
    var body: some View {
        Rectangle()
            .stroke(style: StrokeStyle(lineWidth: 2, dash: [5]))
            .foregroundColor(.red)
            .frame(width: 111, height: 111)
    }
}
Dotted Line Border
 
 
Q