Basic calculator in Swift 3 I just started learning the basics to Swift 3 about 2 days ago. Since then, I've decided to make a simple calculator that can only do one operation at a time. 

I was wondering how efficient this was and what I could possibly do to make it more efficient. Any type of criticism would be helpful too

import UIKit

class ViewController: UIViewController {

    @IBOutlet var buttonResponseLabel: UILabel!
    var userIsCurrentlyTyping: Bool = false
    var storedValue: Int = 0;
    var currentOperation = 0
    var currentNumberInLabel = ""

    @IBAction func buttonAppend(_ sender: UIButton)
    {
        let buttonTitle = sender.currentTitle!


        switch buttonTitle
        {
            case "+":
            currentOperation = 1
            storedValue = Int(currentNumberInLabel)!
            buttonResponseLabel.text = ""
            case "-":
            currentOperation = 2
            storedValue = Int(currentNumberInLabel)!
            buttonResponseLabel.text = ""
            case "*":
            currentOperation = 3
            storedValue = Int(currentNumberInLabel)!
            buttonResponseLabel.text = ""
            case "/":
            currentOperation = 4
            storedValue = Int(currentNumberInLabel)!
            buttonResponseLabel.text = ""
            default:


            if buttonTitle == "="
            {
                var finalValue = 0
                print(currentNumberInLabel)
                let secondStoredValue = Int(currentNumberInLabel)!
                if currentOperation == 1
                {
                    finalValue = storedValue + secondStoredValue
                    buttonResponseLabel.text = ""
                    buttonResponseLabel.text = String(finalValue)
                }
                else if currentOperation == 2
                {
                    finalValue = storedValue - secondStoredValue
                    buttonResponseLabel.text = ""
                    buttonResponseLabel.text = String(finalValue)
                }
                else if currentOperation == 3
                {
                    finalValue = storedValue * secondStoredValue
                    buttonResponseLabel.text = ""
                    buttonResponseLabel.text = String(finalValue)
                }
                else if currentOperation == 4
                {
                    finalValue = storedValue / secondStoredValue
                    buttonResponseLabel.text = ""
                    buttonResponseLabel.text = String(finalValue)
                }
            }
            else
            {
                if userIsCurrentlyTyping
                {
                    currentNumberInLabel = buttonResponseLabel.text! + buttonTitle
                    buttonResponseLabel.text = currentNumberInLabel
                }
                else
                {
                    userIsCurrentlyTyping = true
                    buttonResponseLabel.text = ""
                    buttonResponseLabel.text = buttonTitle
                }

            }

            print("\(currentOperation) \(buttonTitle)")
        }

    }

}
Try not to repeat yourself and refactor common code to functions. Also you might want to create types (classes, structs, enums) to make things more expressive. Quick example with not so nice new data type (untested):

import UIKit

class ViewController: UIViewController {

    struct Operator {
        var stringRepresentation: String
        var `operator`: (Int, Int) -&gt; Int //quotes required  as operator is a keyword
    }

    var operators = ["+":Operator(stringRepresentation:"+", operator:+),
                 "-":Operator(stringRepresentation:"-", operator:-),
                 "*":Operator(stringRepresentation:"*", operator:*),
                 "/":Operator(stringRepresentation:"/", operator:/)]
    @IBOutlet var buttonResponseLabel: UILabel!
    var userIsCurrentlyTyping: Bool = false
    var storedValue: Int = 0;
    var currentOperation: Operator?
    var currentNumberInLabel = ""
    var buttonTitle = ""

    @IBAction func buttonAppend(_ sender: UIButton) {
        buttonTitle = sender.currentTitle!

        if let chosenOperator = operators[buttonTitle] {
            currentOperation = chosenOperator
            storedValue = Int(currentNumberInLabel)!
            buttonResponseLabel.text = ""
        } else if buttonTitle == "=" {
            showResult()
        } else if userIsCurrentlyTyping {
            currentNumberInLabel = buttonResponseLabel.text! + buttonTitle
            buttonResponseLabel.text = currentNumberInLabel
        } else {
            userIsCurrentlyTyping = true
            buttonResponseLabel.text = buttonTitle
        }

        print("\(currentOperation) \(buttonTitle)")
    }

    func showResult() {
        print(currentNumberInLabel)
        guard let currentOperator = currentOperation else {
            print("This should never happen. Fail silently")
            return
        }
        operate(withOperator: currentOperator.operator)
    }

    func operate(withOperator op: (Int, Int) -&gt; Int){
        let secondStoredValue = Int(currentNumberInLabel)!
        let finalValue = op(storedValue, secondStoredValue)
        buttonResponseLabel.text = String(finalValue)
    }
}


A very good walk-through Swift by implementing a calculator can be found here btw. It's from late 2015, so no Swift3. Maybe you find an update.