title: If else statement on ForegroundColor SwiftUI
body: <p>I wanted to do a simple if-else statement on a button</p>
  <pre><code>Button(action: {self.theSoal = nomor.id}) {
              Circle()
                  .frame(width:80,height: 80, alignment:.center)
                  .foregroundColor(.blue)
                  .overlay(
                      Text(&quot;99&quot;)
                          .font(.title)
                          .fontWeight(.bold)
                          .foregroundColor(.white)
                      
                  )
          }
  </code></pre>
  <p>see that .blue, so I wanted to a conditional statement of if the button is clicked then the color change from .blue to .yellow</p>
  <p>how do I do it?? well so far my options are using a state?</p>
  <pre><code>state color = &quot;blue&quot;
  
  if the button is pushed then color = &quot;yellow&quot;
  </code></pre>
  <p>shortish, but it's not good and I need to add the color to my self</p>
  <p>so is there a way to deal with it??</p>
  <p>This is how the button looks like
  <a href="https://i.stack.imgur.com/oQ0IK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oQ0IK.png" alt="enter image description here" /></a></p>