ScrollGeometry
A type that defines the geometry of a scroll view.
Declaration
type ScrollGeometry = { readonly bounds: CGRect; readonly containerSize: CGSize; readonly contentInsets: EdgeInsets; readonly contentOffset: CGPoint; readonly contentSize: CGSize; readonly debugDescription: string; readonly visibleRect: CGRect; };struct ScrollGeometryProperties
bounds*CGRectThe bounds rect of the scroll view.
containerSize*CGSizeThe size of the container of the scroll view.
contentInsets*EdgeInsetsThe content insets of the scroll view.
contentOffset*CGPointThe content offset of the scroll view.
contentSize*CGSizeThe size of the content of the scroll view.
debugDescription*stringA textual representation of this instance, suitable for debugging.
visibleRect*CGRectThe visible rect of the scroll view.
Overview
SwiftUI provides you values of this type when using modifiers like
View.onScrollGeometryChange(_:action:) or
View.onScrollPhaseChange(_:).
From Apple’s SwiftUI documentation. Code samples there are Swift.
See also
More in Layout.
- AlignmentAn alignment in both axes.
- ContainerBackgroundPlacementThe placement of a container background.
- ContainerValuesReadableKeys of SwiftUI ContainerValues JavaScript can read.
- ContainerValuesWritableKeys of SwiftUI ContainerValues JavaScript can write.
- ControlSizeThe size classes, like regular or small, that you can apply to controls within a view.
- DocumentLaunchGeometryProxyA proxy for access to the frame of the scene and its title view.
- DynamicTypeSizeA Dynamic Type size, which specifies how large scalable content should be.
- EdgeAn enumeration to indicate one edge of a rectangle.
- EdgeInsetsThe inset distances for the sides of a rectangle.
- EdgeInsetsChainEdgeInsets with chained calls: SwiftUI.EdgeInsets.inset(...).
- EdgeSetAn efficient set of edges.
- GeometryProxyA proxy for access to the size and coordinate space (for anchor resolution) of the container view.