title: How can I create a text with Checkbox in SwiftUI?
body: <p>I have a requirement of <strong>Checkbox</strong> (✅ as in to-do list) with textfield. Currently I have created button object like below : </p>
  
  <pre><code>    Button(action: {
              // do when checked / unchecked
              //...
      }) {
          HStack(alignment: .top, spacing: 10) {
  
              Rectangle()
                  .fill(Color.white)
                  .frame(width:20, height:20, alignment: .center)
                  .cornerRadius(5)
              Text("Todo  item 1")
          }
      }
  </code></pre>
  
  <p>I need to preserve <code>checked</code> and <code>unchecked</code> state in SwiftUI.</p>
  
  <p><a href="https://i.stack.imgur.com/YBtJJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YBtJJ.png" alt="checkbox sample image"></a></p>