---
title: "visualEffect(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/visualeffect(_:)"
---

# visualEffect(_:)

Applies effects to this view, while providing access to layout information through a geometry proxy.

## Declaration

```swift
nonisolated func visualEffect(_ effect: @escaping @Sendable (EmptyVisualEffect, GeometryProxy) -> some VisualEffect) -> some View

```

## Parameters

- `effect`: A closure that returns the effect to be applied. The first argument provided to the closure is a placeholder representing this view. The second argument is a GeometryProxy.

## Return Value

Return Value A view with the effect applied.

## Discussion

Discussion You return new effects by calling functions on the first argument provided to the effect closure. In this example, ContentView is offset by its own size, causing its top left corner to appear where the bottom right corner was originally located: ContentView()     .visualEffect { content, geometryProxy in         content.offset(geometryProxy.size)     }

## See Also

### Applying effects based on geometry

- [visualEffect3D(_:)](swiftui/view/visualeffect3d(_:).md)
- [VisualEffect](swiftui/visualeffect.md)
- [EmptyVisualEffect](swiftui/emptyvisualeffect.md)
