title: SwiftUI - Check if a value is present in an array
body: <p>I have an array with several objects each with a name and a password. Elsewhere I have a value and I would like to check if this value is already equal to a name in the array.
  In my code, if the value is not equal to a "name" value in the array, I use the add() function.
  I have no idea how to do this at all. Do you have any advice or a simple code for me please?</p>
  
  <pre><code>struct Object  {
      var name : String
      var password : String
  }
  
  struct ContentView: View {
      @State var valeur : String = "x"
      @State var array = [Object]()
      // Let's say it's filled
  
      var body: some View {
          VStack{
              Button(action: {
                  if ... {
                      self.addRow()
                  }
              }) {
                   Text("Add")
              }
          }
      }
  }
  </code></pre>