I want to apply the current date as title to a button once it is tapped by the user. I already have the button read "USED" once clicked, but I want it to include the date too. For example, the button is clicked on January 1st 2018, how would I get it to read "USED 01/01/18"? And on the contrary, if it was used the second of january it would need to read "USED 01/02/18" My code for the toggle button is included below, my particular button only toggles once.
var didClick: Bool = false
@IBAction func special1BTNpressed(_ sender: UIButton) {
if !didClick {
didClick = true
sender.setTitle("USED", for: .normal)
}
}