LoginSignup
0
0

More than 5 years have passed since last update.

超初見者による超簡単カウンターアプリ。(レイアウト無視)

Posted at

import UIKit

class ViewController: UIViewController {

@IBOutlet var countLabel: UILabel!

var resultBox = 0


override func viewDidLoad() {
    super.viewDidLoad()
    countLabel.backgroundColor = UIColor.blue

}

@IBAction func puls(_ sender: Any) {

    resultBox +=  1

// countLabelのtextに整数を文字列に変換して入れる事
    countLabel.text = String(resultBox)

}

@IBAction func minus(_ sender: Any) {

    resultBox -=  1

    countLabel.text = String(resultBox)

}



override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}

}

スクリーンショット 2018-08-27 0.00.55.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0