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.
Platform Compatibility
Tags
SwiftUI Code
ScrollView([.horizontal, .vertical]) {
Image(.cats)
}
#if os(macOS)
.scrollGestureAxisLock(.disabled)
#else
.scrollGestureAxisLock(.directional)
#endif