How to Implement the Pull-to-Refresh Feature in iOS 18 - #30DaysOfSwift | HackerNoon
Briefly

To add a pull-to-refresh feature, we can use the .refreshable modifier available in SwiftUI. This modifier simplifies the implementation process and allows us to handle the refresh action with minimal code.
In the ContentView struct, we define a list of items and implement a refreshable functionality that asynchronously loads data, simulating a network delay and updating the list.
The loadData function updates the state to indicate loading, waits for a specified duration to simulate data fetching, and then adds a new item to the list.
Using .refreshable within a NavigationView enhances the user experience by allowing seamless content refresh with just a pull gesture, leveraging asynchronous Swift capabilities.
Read at Hackernoon
[
|
]