ScrollView + .refreshable

How can I add a native UX for pull-to-refresh for a ScrollView? Is support for this being added in iOS 16? Right now, the native UX only appears for List.

For example, I want to support to be able to support .refreshable on a ScrollView like this:

var body: some View {

    ScrollView {
      LazyVStack {
        Text("1")
        Text("2")
        Text("3")
      }
    }
    .refreshable {
      ///
    }

  }
Answered by BabyJ in 723491022

As of iOS 16 beta 4 this now works.

ScrollView {
    ...
}
.refreshable {
    // refresh action
}

+1, I also would like to know it.

Accepted Answer

As of iOS 16 beta 4 this now works.

ScrollView {
    ...
}
.refreshable {
    // refresh action
}

It looks like this ScrollView + .refreshable solution works for devices that run iOS 16+ only. Is it suppose to be like that? There are no comments in documentation, also no compile time errors/warnings...

ScrollView + .refreshable
 
 
Q