title: How to create an int that cannot be negative swift
body: <p>This is a code 
  I want do a game but money go under 0
  If you can I want an alert for no enough money
  I create an if money - cost > 0 and if self.money - self.cost > 0</p>
  
  <pre><code>struct ContentView: View {
      @State var money = 0
      @State var cost = 1
      @State var addToTap = 1
      var body: some View {
          VStack(alignment: .center, spacing: 5.0){
              Text("money = \(money)")
              Text("$/tap=\(self.addToTap)")
              Spacer()
                  .frame(height: 50)
              Button(action: {
                  self.money += self.addToTap
              }) {
                  Text("  Tap!  ")
                  .font(.title)
                  .fontWeight(.medium)
                  .foregroundColor(.blue)
                  .overlay(
                      RoundedRectangle(cornerRadius:20)
                          .stroke(Color.blue, lineWidth: 3))
              }
              Button(action: {
                  if &lt;#condition#&gt; {
                      self.cost += 1;
                      self.money -= self.cost;
                      self.addToTap += 1
                  } else {
                      &lt;#statements#&gt;
                  }
              }) {
                  Text("  Buy!  ")
                  .font(.title)
                  .fontWeight(.medium)
                  .foregroundColor(.red)
                  .overlay(
                      RoundedRectangle(cornerRadius:20)
                          .stroke(Color.red, lineWidth: 3))
              }
          }
      }
  }
  </code></pre>
  
  <p>Thanks:)</p>