title: how to limit button clicked by time passed swift
body: <p>I need a button where the user clicks to let everyone know they are attending a location, but I only want it to be able to be clicked up to 3 times per 24hrs depending on the contents of the button, as there is a tableView with one button per cell</p>
  
  <p>I haven't tried anything as I have never used time in swift still new to it</p>
  
  <pre><code>@IBAction func myButtonClicked(_ sender: Any) {
      DataService.ds.REF_BARS.child(imageTitleLabel.text!).child("GoingCount").observeSingleEvent(of: .value, with: { (snapshot) in
          print(snapshot.value as! String)
          self.countString = snapshot.value as! String
          self.countInt = Int(self.countString)! + 1
          DataService.ds.REF_BARS.child(self.imageTitleLabel.text!).updateChildValues(["GoingCount": String(self.countInt)])
      })
  }
  </code></pre>
  
  <p>if you can add the pre or post condition of user clicks in or around that button</p>