<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/MagnifyGesture",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14MagnifyGestureV"
  },
  "title" : "MagnifyGesture"
}
-->

# MagnifyGesture

A gesture that recognizes a magnification motion and tracks the amount of
magnification.

```
nonisolated struct MagnifyGesture
```

## Overview

A magnify gesture tracks how a magnification event sequence changes.
To recognize a magnify gesture on a view, create and configure the
gesture, and then add it to the view using the
[`gesture(_:including:)`](/documentation/SwiftUI/View/gesture(_:including:)) modifier.

Add a magnify gesture to a [`Circle`](/documentation/SwiftUI/Circle) that changes its size while the
user performs the gesture:

```
struct MagnifyGestureView: View {
    @GestureState private var magnifyBy = 1.0

    var magnification: some Gesture {
        MagnifyGesture()
            .updating($magnifyBy) { value, gestureState, transaction in
                gestureState = value.magnification
            }
    }

    var body: some View {
        Circle()
            .frame(width: 100, height: 100)
            .scaleEffect(magnifyBy)
            .gesture(magnification)
    }
}
```

## Topics

### Creating the gesture

[`init(minimumScaleDelta:)`](/documentation/SwiftUI/MagnifyGesture/init(minimumScaleDelta:))

Creates a magnify gesture with a given minimum delta for the
gesture to start.

[`init(minimumScaleDelta:inputKinds:)`](/documentation/SwiftUI/MagnifyGesture/init(minimumScaleDelta:inputKinds:))

Creates a magnify gesture with a given minimum delta for the gesture
to start, and the input kinds the gesture recognizes.

[`minimumScaleDelta`](/documentation/SwiftUI/MagnifyGesture/minimumScaleDelta)

The minimum required delta before the gesture starts.



---

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)