One Logo Pool Ball
SwiftUI · IOS API REFERENCE

MagnifyGesture

struct · iOS 17.0+ · SDK 27.1

nonisolated struct MagnifyGesture

A gesture that recognizes a magnification motion and tracks the amount of magnification. 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 ``View/gesture(_:including:)`` modifier. Add a magnify gesture to a ``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) } }

Members (4)

init · iOS 27.0+

init

TypeScript
static initMinimumScaleDeltaInputKinds(minimumScaleDelta?: number, inputKinds?: _SwiftUICore_GestureInputKinds): MagnifyGesture
Swift declaration
nonisolated init(minimumScaleDelta: CGFloat = 0.01, inputKinds: GestureInputKinds = .all)

Creates a magnify gesture with a given minimum delta for the gesture to start, and the input kinds the gesture recognizes. - Parameters: - minimumScaleDelta: The minimum scale delta required before the gesture starts. - inputKinds: A set of input kinds that this gesture recognizes. If not specified, the gesture will recognize all applicable input kinds that a person can use to perform it.

get · iOS 17.0+

minimumScaleDelta

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

The minimum required delta before the gesture starts.

set · iOS 17.0+

minimumScaleDelta

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

The minimum required delta before the gesture starts.

init · iOS 17.0+

init

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

Creates a magnify 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 →