[SwiftUI] Buttonにボーダーをつける

struct DeleteEventButton: View {
  
  let color: Color

  var body: some View {
    
    Button(action: {}) {
      Image(uiImage: Asset.cancelEvent.image)
    }
    .buttonStyle(StrokedButtonStyle(color: color))
    
  }

}

struct StrokedButtonStyle: ButtonStyle {
  
  let color: Color
      
  func makeBody(configuration: Self.Configuration) -> some View {
    configuration.label
      .foregroundColor(color)
      .padding(10)
      .background(
        RoundedRectangle(cornerRadius: .infinity)
          .stroke(color, lineWidth: 2)
    )
  }
  
}

struct _Preview_DeleteEventButton: PreviewProvider {
  
  static var previews: some View {
    Group {
      
      DeleteEventButton(color: .appRed)
        .previewLayout(.fixed(width: 100, height: 100 ))
    }
  }
  
}

image