title: Avoid button styling its content in SwiftUI
body: <p>I'm creating an iOS app using Apple's SwiftUI framework. As I need to detect if the user taps on a specific area of the screen, I obviously use a button.</p>
  
  <p>The problem is that the area contains an Image and a Text, and as the button automatically gives its content the blue color, the image is also colored, so instead of being an Image it's just a blue rounded rectangle.</p>
  
  <p>It is said that an image is worth a thousand words, and as I'm not good at explaining, here you have a graphic demonstration of what happens:</p>
  
  <p><strong>Outside the button (without button styling)</strong>
  <a href="https://i.stack.imgur.com/7uLr2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7uLr2.png" alt="without button styling"></a></p>
  
  <p><strong>Inside the button (with button styling)</strong>
  <a href="https://i.stack.imgur.com/AAYUp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AAYUp.png" alt="with button styling"></a></p>
  
  <p>This happens because the button is adding <code>.foregroundColor(.blue)</code> to the image.</p>
  
  <p>How can I avoid/disable the button adding style to its components?</p>
  
  <p><strong>EDIT</strong>: This is my button code:</p>
  
  <p><em>ContentView.swift</em>:</p>
  
  <pre><code>Button(action: {/* other code */}) {
                      PackageManagerRow(packageManager: packageManagersData[0])
                  }
  </code></pre>
  
  <p><em>PackageManagerRow.swift</em>:</p>
  
  <pre><code>struct PackageManagerRow : View {
      var packageManager : PackageManager
  
      var body: some View {
          VStack {
              HStack {
                  Image(packageManager.imageName)
                      .resizable()
                      .frame(width: 42.0, height: 42.0)
                  Text(verbatim: packageManager.name)
                  Spacer()
                  Image(systemName: "checkmark")
                      .foregroundColor(.blue)
                      .opacity(0)
              }.padding(.bottom, 0)
              Divider()
                  .padding(.top, -3)
          }
      }
  }
  </code></pre>