ButtonStyleModifier.swift 341 B

123456789
  1. extension View {
  2. /// Sets the style for buttons within this view to a button style with
  3. /// a custom appearance and standard interaction behavior.
  4. public func buttonStyle(_ style: ButtonStyle?) -> some View {
  5. EnvironmentModifier(self) { environment in
  6. environment.with(\.buttonStyle, style)
  7. }
  8. }
  9. }