From aa3277628a1d4df38b3a64a56e5c01e9dd5148c2 Mon Sep 17 00:00:00 2001 From: Pin Lin Date: Wed, 6 May 2020 05:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E5=8E=9F=E6=9C=AC=20formula=20?= =?UTF-8?q?=E6=94=B9=E5=90=8D=E6=88=90=20process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AndroidCalculator/Base.lproj/Main.storyboard | 2 +- AndroidCalculator/Calculator.swift | 6 +++--- AndroidCalculator/ViewController.swift | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AndroidCalculator/Base.lproj/Main.storyboard b/AndroidCalculator/Base.lproj/Main.storyboard index 3f3d991..5e12480 100644 --- a/AndroidCalculator/Base.lproj/Main.storyboard +++ b/AndroidCalculator/Base.lproj/Main.storyboard @@ -246,7 +246,7 @@ - + diff --git a/AndroidCalculator/Calculator.swift b/AndroidCalculator/Calculator.swift index 540befe..9656303 100644 --- a/AndroidCalculator/Calculator.swift +++ b/AndroidCalculator/Calculator.swift @@ -9,14 +9,14 @@ import Foundation class Calculator { - var formula = "" + var process = "" var result = "" func click(_ text: String) { if text == "AC" { - formula = "" + process = "" } else { - formula += text + process += text } } } diff --git a/AndroidCalculator/ViewController.swift b/AndroidCalculator/ViewController.swift index 3c6fb05..be6d7bc 100644 --- a/AndroidCalculator/ViewController.swift +++ b/AndroidCalculator/ViewController.swift @@ -11,7 +11,7 @@ import UIKit class ViewController: UIViewController { @IBOutlet weak var borderView: UIView! - @IBOutlet weak var formulaLabel: UILabel! + @IBOutlet weak var processLabel: UILabel! @IBOutlet weak var resultLabel: UILabel! @IBOutlet var numberButtons: [UIButton]! @@ -23,7 +23,7 @@ class ViewController: UIViewController { } func updateView() { - formulaLabel.text = calculator.formula + processLabel.text = calculator.process resultLabel.text = calculator.result }