title: SwiftUI @State to change an Image being displayed
body: <p>I have a Dictionary created from reading in JSON data and I am using those Variable names to populate other Views.</p>
  
  <p>SO I have
  <code>var charFullDetail: charDetail</code></p>
  
  <p>This returns a number of variables, but the two I am interested in are:
  charFullDetail.cardFrontImage
  charFullDetail.cardBackImage</p>
  
  <p>These contain Strings which equate to an Image saved in the Asset Catalog.</p>
  
  <p>My View then uses those variables to display the Image</p>
  
  <p><code>Image(charFullDetail.cardFrontImage)</code></p>
  
  <p>This works fine.</p>
  
  <p>What I want to be able to do is turn the Image above into something dynamic, so that either it is tapped or a button is pressed and the Image displays the opposite one.</p>
  
  <p>So if .cardFrontImage is being displayed and I tap the picture I want it to replace the Image with 
  <code>Image(charFullDetail.cardBackImage</code></p>
  
  <p>I cannot get the code working that does this - my thought was to make a @State variable and use that in the Image() so that if that variable gets changed the Image() would update.</p>
  
  <p>But if I do
  <code>@State var card = "charFullDetail.cardFrontImage"</code></p>
  
  <p>and then try to use
  <code>Image(card)</code></p>
  
  <p>It is failing as it cannot find the picture, as it is using the literal String as a String rather than referring to the value of that variable - if that makes sense.</p>
  
  <p>Basically how can I replace using the reference charFullDetail.cardFrontImage with a stateful variable, but get it to still reference the value and not see it as String "charFullDetail.cardFrontImage"?</p>