Skip to content

Instantly share code, notes, and snippets.

@masakid
Last active August 29, 2015 14:16
Show Gist options
  • Save masakid/02c57a6990ed92136d9d to your computer and use it in GitHub Desktop.
Save masakid/02c57a6990ed92136d9d to your computer and use it in GitHub Desktop.
lesson4
//
// ViewController.swift
// Problem_part4
//
// Created by masakid on 2015/03/10.
// Copyright (c) 2015年 masaki.k. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var countLabel: UILabel!
@IBAction func pressPlusButton(sender: AnyObject) {
let num = self.countLabel.text?.toInt() ?? 0
self.countLabel.text = "\(num + 1)"
}
@IBAction func pressClear(sender: AnyObject) {
self.countLabel.text = "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.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment