發新話題
打印

Stanford - Developing iOS 9 Apps with Swift

Stanford - Developing iOS 9 Apps with Swift

Stanford - Developing iOS 9 Apps with Swift - 1. Course Overview and iOS9 introduction

TOP

TOP

//
//  ViewController.swift
//  Calculator

//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var display: UILabel? = nil
   
    var userIsInTheMiddleofTyping: Bool = false
   
    @IBAction func touchDigit(_ sender: UIButton) {
        let digit = sender.currentTitle! //Excamation mark for unwarp an option's associate value
        let textCurrentlyInDisplay = display!.text!
        display!.text = textCurrentlyInDisplay + digit
    }

}

============
Shina Yuna

TOP

發新話題