One Logo Pool Ball
SwiftUI · IOS API REFERENCE

MagnificationGesture

struct · iOS 13.0+ · Deprecated in iOS 100000.0 · SDK 27.1

nonisolated struct MagnificationGesture

A gesture that recognizes a magnification motion and tracks the amount of magnification. A magnification gesture tracks how a magnification event sequence changes. To recognize a magnification gesture on a view, create and configure the gesture, and then add it to the view using the ``View/gesture(_:including:)`` modifier. Add a magnification gesture to a ``Circle`` that changes its size while the user performs the gesture: struct MagnificationGestureView: View { @GestureState private var magnifyBy = 1.0 var magnification: some Gesture { MagnificationGesture() .updating($magnifyBy) { currentState, gestureState, transaction in gestureState = currentState } } var body: some View { Circle() .frame(width: 100, height: 100) .scaleEffect(magnifyBy) .gesture(magnification) } } The circle's size resets to its original size when the gesture finishes.

Members (3)

get · iOS 13.0+ · Deprecated in iOS 100000.0

minimumScaleDelta

TypeScript
get minimumScaleDelta(): number
Swift declaration
var minimumScaleDelta: CGFloat

The minimum required delta before the gesture starts.

set · iOS 13.0+ · Deprecated in iOS 100000.0

minimumScaleDelta

TypeScript
set minimumScaleDelta(value: number)
Swift declaration
var minimumScaleDelta: CGFloat

The minimum required delta before the gesture starts.

init · iOS 13.0+ · Deprecated in iOS 100000.0

init

TypeScript
static init(minimumScaleDelta?: number): MagnificationGesture
Swift declaration
nonisolated init(minimumScaleDelta: CGFloat = 0.01)

Creates a magnification gesture with a given minimum delta for the gesture to start. - Parameter minimumScaleDelta: The minimum scale delta required before the gesture starts.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →