title: Conditionally Text in SwiftUI depending on Array value
body: <p>I want make placeholder custom style so i try to use the method of Mojtaba Hosseini in <a href="https://stackoverflow.com/questions/57688242/swiftui-how-to-change-the-placeholder-color-of-the-textfield?answertab=oldest#tab-top">SwiftUI. How to change the placeholder color of the TextField?</a></p>
  
  <pre><code>if text.isEmpty {
              Text("Placeholder")
                  .foregroundColor(.red)
          }
  </code></pre>
  
  <p>but in my case, I use a foreach with a Array for make a list of Textfield and Display or not the Text for simulate the custom placeholder.</p>
  
  <pre><code>          ForEach(self.ListeEquip.indices, id: \.self) { item in
       ForEach(self.ListeJoueurs[item].indices, id: \.self){idx in
  // if self.ListeJoueurs[O][O] work
          if self.ListeJoueurs[item][index].isEmpty {
                                      Text("Placeholder")
                                          .foregroundColor(.red)
                                  }
      }
      }
  </code></pre>
  
  <p>How I can use dynamic conditional with a foreach ? </p>
  
  <hr>
  
  <p>Now I have a another problem :</p>
  
  <p>i have this code : </p>
  
  <pre><code>struct EquipView: View {
      @State var ListeJoueurs = [
          ["saoul", "Remi"],
          ["Paul", "Kevin"]
      ]
      @State var ListeEquip:[String] = [
          "Rocket", "sayans"
      ]
  
      var body: some View {
          VStack { // Added this
              ForEach(self.ListeEquip.indices) { item in
  
                  BulleEquip(EquipName: item, ListeJoueurs: self.$ListeJoueurs, ListeEquip: self.$ListeEquip)
  
              }
          }
      }
  
  }
  
  
  struct BulleEquip: View {
      var EquipName = 0
      @Binding var ListeJoueurs :[[String]]
      @Binding var ListeEquip :[String]
  
      var body: some View {
          VStack{
          VStack{
              Text("Équipe \(EquipName+1)")
          }
          VStack { // Added this
              ForEach(self.ListeJoueurs[EquipName].indices) { index in
                  ListeJoueurView(EquipNamed: self.EquipName, JoueurIndex: index, ListeJoueurs: self.$ListeJoueurs, ListeEquip: self.$ListeEquip)
              }
              HStack{
              Button(action: {
                  self.ListeJoueurs[self.EquipName].append("")  //problem here
              }){
                  Text("button")
                  }
              }
          }
      }
      }
  
  }
  
  struct ListeJoueurView: View {
      var EquipNamed = 0
      var JoueurIndex = 0
      @Binding var ListeJoueurs :[[String]]
      @Binding var ListeEquip :[String]
  
      var body: some View {
          HStack{
              Text("Joueur \(JoueurIndex+1)")
          }
      }
  
  }
  </code></pre>
  
  <p>I can run the App but I have this error in console when I click the button : 
  ForEach, Int, ListeJoueurView> count (3) != its initial count (2). <code>ForEach(_:content:)</code> should only be used for <em>constant</em> data. Instead conform data to <code>Identifiable</code> or use <code>ForEach(_:id:content:)</code> and provide an explicit <code>id</code>!</p>
  
  <p>Can someone enlighten me?</p>