Wednesday, December 6, 2023
HomeiOS Developmentios - The way to recreate pull-to-refresh performance on a horizontal ScrollView...

ios – The way to recreate pull-to-refresh performance on a horizontal ScrollView in SwiftUI?


I am creating an iOS app that incorporates a horizontally scrolling media feed. I need to implement a pull-to-refresh function that refreshes a customers feed when pulled proper. Does anybody know if there’s a native solution to obtain this? Or a solution to recreate pull-to-refresh performance horizontally?

Trying this code with the .refreshable modifier yields no outcomes when the content material is dragged proper. I assume the pull-to-refresh gesture is barely designed for vertical scrolling, however I’m not sure.

// XCode 15, iOS 17

ScrollView(.horizontal) {
    LazyHStack {
        content material...
    }
}
.refreshable {
    motion...
}



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments