Generic Structure


A scrollable view.


struct ScrollView<Content> where Content : View


The scroll view displays its content within the scrollable content region.


Creating a Scroll View

init(Axis.Set, showsIndicators: Bool, content: () -> Content)

Creates a new instance that’s scrollable in the direction of the given axis and can show indicators while scrolling.

Configuring a Scroll View

var content: Content

The scroll view’s content.

var axes: Axis.Set

The scrollable axes of the scroll view.

var showsIndicators: Bool

A value that indicates whether the scroll view displays the scrollable component of the content offset, in a way that’s suitable for the platform.

Applying Standard Modifiers

View Modifiers

Configure this view and the views it contains by applying standard modifiers.


Conforms To

See Also

Lists and Scroll Views

struct List

A container that presents rows of data arranged in a single column.

struct ForEach

The collection of underlying identified data that SwiftUI uses to create views dynamically.

protocol DynamicViewContent

A type of view that generates views from an underlying collection of data.

protocol Identifiable

A class of types whose instances hold the value of an entity with stable identity.

enum Axis

The horizontal or vertical dimension in a 2D coordinate system.