title: Pull down to refresh data in SwiftUI
body: <p>i have used simple listing of data using <code>List</code>. I would like to add pull down to refresh functionality but i am not sure which is the best possible approach.</p>
  
  <p>Pull down to refresh view will only be visible when user tries to pull down from the very first index same like we did in <code>UITableView</code> with <code>UIRefreshControl</code> in <code>UIKit</code></p>
  
  <p>Here is simple code for listing data in <code>SwiftUI</code>.</p>
  
  <pre><code>struct CategoryHome: View {
      var categories: [String: [Landmark]] {
          .init(
              grouping: landmarkData,
              by: { $0.category.rawValue }
          )
      }
  
      var body: some View {
          NavigationView {
              List {
                  ForEach(categories.keys.sorted().identified(by: \.self)) { key in
                      Text(key)
                  }
              }
              .navigationBarTitle(Text("Featured"))
          }
      }
  }
  </code></pre>