Last active
August 29, 2015 14:16
-
-
Save masakid/02c57a6990ed92136d9d to your computer and use it in GitHub Desktop.
lesson4
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
// | |
// 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