Created
March 2, 2018 19:07
-
-
Save groue/a8eadeea92c7d5b0ba9f49177fc6d1fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var button: UIButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var counter = 0 | |
button.onTouchUpInside { button in | |
counter += 1 | |
button?.setTitle("Taps: \(counter)", for: .normal) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment