title: SwiftUI - Close Keyboard on Scroll
body: <p>I have a simple search list:</p>
  
  <pre class="lang-swift prettyprint-override"><code>
  struct ContentView: View {
      @State var text:String = ""
      var items = 1...100
      var body: some View {
          VStack {
              List {
                  TextField("Search", text: $text)
                  Section{
                      ForEach(items.filter({"\($0)".contains(text)}),id: \.self){(i) in
                         Text("option \(i)")
                      }
                  }
              }
          }
      }
  }
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/t8R29.png" rel="noreferrer"><img src="https://i.stack.imgur.com/t8R29.png" alt="iOS simulator screenshot"></a><br><br>
  How can I make the keyboard close when scrolling for more than 2 cells/few points?</p>