Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

//

//
//
//
//
//
//

ViewController.swift
ctapp
Created by anthony edwards on 6/23/15.
Copyright (c) 2015 Anthony Edwards. All rights reserved.

import UIKit
class ViewController: UIViewController {
@IBOutlet var outputLabel: UILabel? = UILabel()
var currentCount = 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 addOneButton(sender: UIButton) {
currentCount = currentCount + 1
outputLabel?.text = "The button has been clicked
\(currentCount) number of times"
outputLabel?.textColor = UIColor.redColor()
}
@IBAction func minsOneButton(sender: UIButton) {
currentCount = currentCount - 1
outputLabel?.text = "The button has been clicked
\(currentCount) number of times"
outputLabel?.textColor = UIColor.purpleColor()
}

You might also like