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 {
      ///
    }

  }

Accepted Reply

As of iOS 16 beta 4 this now works.

ScrollView {
    ...
}
.refreshable {
    // refresh action
}
  • Wow! Confirmed, this works on iOS 16 beta 4 and 5. Thanks for the heads up.

Add a Comment

Replies

+1, I also would like to know it.

As of iOS 16 beta 4 this now works.

ScrollView {
    ...
}
.refreshable {
    // refresh action
}
  • Wow! Confirmed, this works on iOS 16 beta 4 and 5. Thanks for the heads up.

Add a Comment

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...