title: SwiftUI - create a single dashed line with SwiftUI
body: <p>I need to create a single dashed line. I tried going about it by creating a Rectangle view with a dashed stroke. However, when setting the height of the rectangle to 1, it results in a double line as its showing both the top and bottom borders of the view.</p>
  <p>This is the code:</p>
  <pre><code>Rectangle()
      .fill(Color.clear)
      .frame(height: 1, alignment: .bottom)
      .overlay(
          RoundedRectangle(cornerRadius: 0)
              .stroke(style: StrokeStyle(lineWidth: 1, dash: [5]))
              .foregroundColor(Color(UIColor.blue))
      )
  </code></pre>