View+blurEffectStyle.swift 529 B

1234567891011121314151617181920212223242526
  1. /**
  2. * SwiftUIVisualEffects
  3. */
  4. import SwiftUI
  5. public extension View {
  6. /**
  7. Sets the style for blur effects within this view.
  8. To set a specific style for all blur effects and vibrancy effects containing blur effects within a view, use the `blurEffectStyle(_:)` modifier:
  9. ```
  10. ZStack {
  11. backgroundContent
  12. .blurEffect()
  13. foregroundContent
  14. .vibrancyEffect()
  15. }
  16. .blurEffectStyle(.systemMaterial)
  17. ```
  18. */
  19. func blurEffectStyle(_ style: UIBlurEffect.Style) -> some View {
  20. environment(\.blurEffectStyle, style)
  21. }
  22. }