import UIKit
class ViewController: UIViewController {
var tapCount:Int = 0
//変数tapCountにInt型の0を代入
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func count(sender: AnyObject) {
//selfで自分を呼び出して自分の中の変数tapCountを += 1でインクリメント
self.tapCount += 1
//printでtapCountがインクリメントされてるかデバックで確認
print(tapCount)
}
}