swift 5 button border code example
Example 1: add buton border swift
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.black.cgColor
Example 2: add border to button swiftui
Button(action: {
print("sign up bin tapped")
}) {
Text("SIGN UP")
.frame(minWidth: 0, maxWidth: .infinity)
.font(.system(size: 18))
.padding()
.foregroundColor(.white)
.overlay(
RoundedRectangle(cornerRadius: 25)
.stroke(Color.white, lineWidth: 2)
)
}