<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/scaleEffect(_:anchor:)-pmi7",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE11scaleEffect_6anchorQr14CoreFoundation7CGFloatV_AA9UnitPointVtF"
  },
  "title" : "scaleEffect(_:anchor:)"
}
-->

# scaleEffect(_:anchor:)

Scales this view’s rendered output by the given amount in both the
horizontal and vertical directions, relative to an anchor point.

```
nonisolated func scaleEffect(_ s: CGFloat, anchor: UnitPoint = .center) -> some View
```

## Parameters

`s`

The amount to scale the view in the view in both the horizontal
and vertical directions.

`anchor`

The anchor point with a default of `UnitPoint/center` that
indicates the starting position for the scale operation.

## Discussion

Use `scaleEffect(_:anchor:)` to apply a horizontally and vertically
scaling transform to a view.

```
Image(systemName: "envelope.badge.fill")
    .resizable()
    .frame(width: 100, height: 100, alignment: .center)
    .foregroundColor(Color.red)
    .scaleEffect(2, anchor: .leading)
    .border(Color.gray)
```

![A screenshot showing a 100x100 pixel red envelope scaled up to 2x the](images/com.apple.SwiftUI/SwiftUI-View-scaleEffect-cgfloat@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)