Interactive previews iPhone

Scroll Gesture Axis Lock

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 27.3+ iPadOS 27.3+ macOS 27.3+ watchOS 27.3+ visionOS 27.3+

Tags

SwiftUI Code

Docs
ScrollView([.horizontal, .vertical]) {
    Image(.cats)
}
#if os(macOS)
.scrollGestureAxisLock(.disabled)
#else
.scrollGestureAxisLock(.directional)
#endif

Found an issue or have a suggestion?

Created: November 17, 2026Updated: November 17, 2026

More View Components

View all
VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview
type

VisionOS background materials

All background materials on visionOS

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Container Content Margins

Adds the margins of the container the view is in.

Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
environment

Toolbar Vertical Edge

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
structure

Hinge State

A type encapsulating the state of a single hinge.

Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Disabled Toolbar Vertical Behavior

Disables the vertical bar.

Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Music Picker

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

App Store Overlay - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

App Store Overlay

Presents a StoreKit overlay when a given condition is true.

Manage Subscriptions Sheet - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Manage Subscriptions Sheet

Opens the manage subscriptions sheet.

Explore Other Components

Browse all
Value Tab View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Value Tab View

Creates a tab view that uses a builder to create and specify selection values for its tabs.

Content Unavailable - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Content Unavailable

A placeholder for empty results with optional button

DatePicker Components  - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

DatePicker Components

A date picker with only one displayed component

Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Tint

Sets the buttons tint color

Pinned Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Pinned Toolbar Item Placement

A placement that pins the item to the trailing edge of the toolbar.

Slider Color - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Slider Color

Customizing the color of the slider

Title Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializers

Title Toolbar Item Placement

Places content in the title area

Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.